N_("Proxy"),
};
+const char *AVIconDrawing::avicon_names[] =
+{
+ N_("Full Play"),
+ N_("Mouse Over"),
+ N_("Src Target"),
+ N_("No Play"),
+};
AssetVIcon::AssetVIcon(AssetPicon *picon, int w, int h, double framerate, int64_t length)
: VIcon(w, h, framerate), Garbage("AssetVIcon")
{
if( running() ) return;
interrupted = 0;
- audio_pos = 0;
+ double pos = vicon->length > 0 ? (double)vicon->seq_no/vicon->length : 0;
+ int audio_len = vicon->audio_size/sizeof(vicon_audio_t);
+ audio_pos = pos * audio_len;
this->vicon = vicon;
Thread::start();
}
void AssetVIcon::stop_audio()
{
- if( playing_audio > 0 )
+ if( playing_audio > 0 ) {
picon->gui->vicon_audio->stop(0);
- playing_audio = 0;
+ playing_audio = 0;
+ }
}
AssetViewPopup::AssetViewPopup(VIconThread *vt, int draw_mode,
AssetVIconThread *avt = (AssetVIconThread *)vt;
if( !avt->vicon ) return 0;
- switch( draw_mode ) {
- case ASSET_VIEW_MEDIA_MAP:
- case ASSET_VIEW_FULL:
- break;
- default:
- return 0;
- }
-
int dir = 1;
switch( get_buttonpress() ) {
case LEFT_BUTTON:
break;
case WHEEL_DOWN:
- dir = -1;
- // fall thru
+ dir = -1; // fall thru
case WHEEL_UP:
- if( draw_mode != ASSET_VIEW_FULL )
- return avt->zoom_scale(dir);
- // fall thru
+ switch( draw_mode ) {
+ case ASSET_VIEW_MEDIA:
+ case ASSET_VIEW_MEDIA_MAP:
+ avt->zoom_scale(dir);
+ return 1;
+ } // fall thru
default:
return 0;
}
}
}
mwindow->gui->lock_window("AssetVIcon::popup_button_press");
- mwindow->select_point(!ctrl_down() && !shift_down() ? pos : start);
+ mwindow->select_point(start);
edl->local_session->set_selectionstart(start);
edl->local_session->set_selectionend(!shift_down() ? start : end);
mwindow->zoom_sample(edl->local_session->zoom_sample);
int AssetViewPopup::cursor_motion_event()
{
- if( !is_event_win() ) return 0;
AssetVIconThread *avt = (AssetVIconThread *)vt;
- if( !avt->vicon ||
- ( draw_mode != ASSET_VIEW_FULL &&
- draw_mode != ASSET_VIEW_MEDIA_MAP ) ) return 0;
- if( !get_button_down() || get_buttonpress() != LEFT_BUTTON ||
- ctrl_down() || alt_down() || shift_down() )
- return 0;
AssetVIcon *vicon = (AssetVIcon *)avt->vicon;
- MWindow *mwindow = vicon->picon->mwindow;
- EDL *edl = mwindow->edl;
- if( dragging ) {
- int x = get_cursor_x();
- double total_length = edl->tracks->total_length();
- double pos = x * total_length / get_w();
- mwindow->gui->lock_window("AssetVIcon::popup_cursor_motion");
- mwindow->select_point(pos);
- mwindow->zoom_sample(edl->local_session->zoom_sample);
- mwindow->gui->unlock_window();
- return 1;
+ if( vicon && dragging && is_event_win() &&
+ get_button_down() && get_buttonpress() == LEFT_BUTTON &&
+ !ctrl_down() && !alt_down() && !shift_down() ) {
+ switch( draw_mode ) {
+ case ASSET_VIEW_MEDIA_MAP:
+ case ASSET_VIEW_FULL:
+ MWindow *mwindow = vicon->picon->mwindow;
+ EDL *edl = mwindow->edl;
+ int x = get_cursor_x();
+ double total_length = edl->tracks->total_length();
+ double pos = x * total_length / get_w();
+ mwindow->gui->lock_window("AssetVIcon::popup_cursor_motion");
+ mwindow->select_point(pos);
+ mwindow->zoom_sample(edl->local_session->zoom_sample);
+ mwindow->gui->unlock_window();
+ return 1;
+ }
}
return 0;
}
void AssetVIconThread::set_view_popup(AssetVIcon *v, int draw_mode)
{
gui->stop_vicon_drawing();
- int mode = !v ? ASSET_VIEW_NONE :
- draw_mode >= 0 ? draw_mode :
- this->draw_mode;
- this->vicon = v;
- this->draw_mode = mode;
+ this->draw_mode = draw_mode;
+ VIconThread::set_view_popup(v);
gui->start_vicon_drawing();
}
+void AssetVIconThread::set_view_popup(AssetVIcon *v)
+{
+ if( !v ) draw_mode = ASSET_VIEW_NONE;
+ VIconThread::set_view_popup(v);
+}
+
ViewPopup *AssetVIconThread::new_view_window()
{
BC_WindowBase *parent = wdw->get_parent();
else
parent->get_fullscreen_geometry(rx, ry, rw, rh);
AssetViewPopup *popup = new AssetViewPopup(this, draw_mode, rx, ry, rw, rh);
- if( draw_mode == ASSET_VIEW_MEDIA_MAP || draw_mode == ASSET_VIEW_FULL )
+ switch( draw_mode ) {
+ case ASSET_VIEW_NONE:
+ case ASSET_VIEW_ICON:
+ case ASSET_VIEW_MEDIA_MAP:
+ case ASSET_VIEW_FULL:
+ vicon->stop_audio();
vicon->playing_audio = -1;
+ break;
+ case ASSET_VIEW_MEDIA:
+ vicon->playing_audio = 1;
+ vicon->start_audio();
+ break;
+ }
wdw->set_active_subwindow(popup);
return popup;
}
remove_plugin = 0;
vicon_thread = 0;
vicon_audio = 0;
- vicon_drawing = 1;
+ vicon_drawing = AVICON_FULL_PLAY;
displayed_folder = AW_NO_FOLDER;
new_folder_thread = 0;
modify_folder_thread = 0;
int fx = mwindow->theme->afolders_x, fy = mwindow->theme->afolders_y;
int fw = mwindow->theme->afolders_w, fh = mwindow->theme->afolders_h;
- VFrame **images = mwindow->theme->get_image_set("playpatch_data");
- AVIconDrawing::calculate_geometry(this, images, &avicon_w, &avicon_h);
- add_subwindow(avicon_drawing = new AVIconDrawing(this, fw-avicon_w, fy, images));
+ const char *text = _("Preview");
+ int tw = get_text_width(MEDIUMFONT, text);
+ int pw = BC_PopupMenu::calculate_w(4, tw, -1);
+ add_subwindow(avicon_drawing = new AVIconDrawing(this, fw, fy, pw, text));
+ avicon_drawing->create_objects();
add_subwindow(add_tools = new AddTools(mwindow, this, fx, fy, _("Visibility")));
add_tools->create_objects();
fy += add_tools->get_h(); fh -= add_tools->get_h();
int fx = mwindow->theme->afolders_x, fy = mwindow->theme->afolders_y;
int fw = mwindow->theme->afolders_w, fh = mwindow->theme->afolders_h;
add_tools->resize_event(fw-avicon_w, add_tools->get_h());
- avicon_drawing->reposition_window(fw-avicon_w, fy);
+ avicon_drawing->reposition_window(fw-avicon_drawing->get_w(), fy);
fy += add_tools->get_h(); fh -= add_tools->get_h();
folder_list->reposition_window(fx, fy, fw, fh);
}
void AWindowGUI::start_vicon_drawing()
{
- if( !vicon_drawing || !vicon_thread->interrupted ) return;
+ if( !vicon_thread->interrupted ) return;
+ switch( vicon_drawing ) {
+ case AVICON_FULL_PLAY: // all vicons, viewing, target
+ case AVICON_MOUSE_OVER: // one vicon, viewing, target
+ break;
+ case AVICON_SRC_TARGET: // no vicons, no view, target
+ case AVICON_NO_PLAY: // no vicons, no view, no target
+ return;
+ }
if( mwindow->edl->session->awindow_folder == AW_MEDIA_FOLDER ||
mwindow->edl->session->awindow_folder == AW_PROXY_FOLDER ||
mwindow->edl->session->awindow_folder == AW_CLIP_FOLDER ||
}
}
-void AWindowGUI::stop_vicon_drawing()
+int AWindowGUI::stop_vicon_drawing()
{
- if( vicon_thread->interrupted ) return;
+ if( vicon_thread->interrupted ) return 0;
vicon_thread->stop_drawing();
+ return 1;
}
void AWindowGUI::close_view_popup()
case WHEEL_UP: {
int x = get_cursor_x(), y = get_cursor_y();
if( avt->cursor_inside(x, y) && avt->view_win )
- return avt->zoom_scale(dir);
+ avt->zoom_scale(dir);
return 1; }
}
}
deactivate_selection();
}
- else if( gui->vicon_drawing && get_button_down() &&
- (item = (AssetPicon*)get_selection(0, 0)) != 0 ) {
- switch( folder ) {
- case AW_MEDIA_FOLDER:
- case AW_PROXY_FOLDER:
- case AWINDOW_USER_FOLDERS:
- if( get_buttonpress() == LEFT_BUTTON ||
- get_buttonpress() == MIDDLE_BUTTON ) {
- AssetVIcon *vicon = 0;
- if( !gui->vicon_thread->vicon )
- vicon = item->vicon;
- int draw_mode = vicon && get_buttonpress() == MIDDLE_BUTTON ?
- ASSET_VIEW_MEDIA_MAP : ASSET_VIEW_MEDIA;
- gui->vicon_thread->set_view_popup(vicon, draw_mode);
- }
- break;
- case AW_CLIP_FOLDER:
- if( get_buttonpress() == LEFT_BUTTON ) {
- AssetVIcon *vicon = 0;
- if( !gui->vicon_thread->vicon )
- vicon = item->vicon;
- gui->vicon_thread->set_view_popup(vicon, ASSET_VIEW_ICON);
+ else if( get_button_down() ) {
+ if( (item = (AssetPicon*)get_selection(0, 0)) != 0 ) {
+ switch( folder ) {
+ case AW_MEDIA_FOLDER:
+ case AW_PROXY_FOLDER:
+ case AWINDOW_USER_FOLDERS:
+ if( get_buttonpress() == LEFT_BUTTON ||
+ get_buttonpress() == MIDDLE_BUTTON ) {
+ AssetVIcon *vicon = 0;
+ AssetVIconThread *avt = gui->vicon_thread;
+ if( !avt->vicon && gui->vicon_drawing != AVICON_NO_PLAY )
+ vicon = item->vicon;
+ int draw_mode = !vicon ?
+ ASSET_VIEW_NONE :
+ get_buttonpress() == MIDDLE_BUTTON ?
+ ASSET_VIEW_MEDIA_MAP : ASSET_VIEW_MEDIA;
+ avt->set_view_popup(vicon, draw_mode);
+ }
+ break;
+ case AW_CLIP_FOLDER:
+ if( get_buttonpress() == LEFT_BUTTON ) {
+ AssetVIcon *vicon = 0;
+ if( !gui->vicon_thread->vicon )
+ vicon = item->vicon;
+ gui->vicon_thread->set_view_popup(vicon, ASSET_VIEW_ICON);
+ }
+ break;
}
- break;
+ }
+ else {
+ gui->vicon_thread->set_view_popup(0);
+ if( gui->vicon_drawing != AVICON_FULL_PLAY )
+ gui->stop_vicon_drawing();
}
}
return 1;
int AWindowAssets::focus_in_event()
{
int ret = BC_ListBox::focus_in_event();
- gui->start_vicon_drawing();
+ switch( gui->vicon_drawing ) {
+ case AVICON_FULL_PLAY:
+ gui->start_vicon_drawing();
+ break;
+ case AVICON_MOUSE_OVER:
+ case AVICON_SRC_TARGET:
+ case AVICON_NO_PLAY:
+ default:
+ break;
+ }
return ret;
}
int AWindowAssets::focus_out_event()
{
gui->stop_vicon_drawing();
+ gui->vicon_thread->set_view_popup(0);
return BC_ListBox::focus_out_event();
}
int AWindowAssets::mouse_over_event(int no)
{
- if( gui->vicon_thread->viewing &&
- no >= 0 && no < gui->displayed_assets[0].size() ) {
- AssetPicon *picon = (AssetPicon *)gui->displayed_assets[0][no];
- gui->vicon_thread->set_view_popup(picon->vicon);
+ AssetPicon *picon = no >= 0 && no < gui->displayed_assets[0].size() ?
+ (AssetPicon *)gui->displayed_assets[0][no] : 0;
+ AssetVIcon *vicon = !picon ? 0 : picon->vicon;
+ switch( gui->vicon_drawing ) {
+ case AVICON_FULL_PLAY:
+ gui->vicon_thread->solo = 0;
+ if( vicon && gui->vicon_thread->viewing )
+ gui->vicon_thread->set_view_popup(vicon);
+ break;
+ case AVICON_MOUSE_OVER:
+ if( !vicon ) break;
+ gui->vicon_thread->solo = vicon;
+ if( gui->vicon_thread->viewing )
+ gui->vicon_thread->set_view_popup(vicon);
+ break;
+ case AVICON_SRC_TARGET:
+ case AVICON_NO_PLAY:
+ default:
+ break;
}
return 0;
}
}
AddTools::AddTools(MWindow *mwindow, AWindowGUI *gui, int x, int y, const char *title)
- : BC_PopupMenu(x, y, BC_Title::calculate_w(gui, title, MEDIUMFONT)+8, title, -1, 0, 4)
+ : BC_PopupMenu(x, y, gui->get_text_width(MEDIUMFONT, title)+8, title, -1, 0, 4)
{
this->mwindow = mwindow;
this->gui = gui;
return 1;
}
-AVIconDrawing::AVIconDrawing(AWindowGUI *agui, int x, int y, VFrame **images)
- : BC_Toggle(x, y, images, agui->vicon_drawing)
+AVIconDrawingItem::AVIconDrawingItem(AVIconDrawing *avicon, const char *text, int id)
+ : BC_MenuItem(text)
{
- this->agui = agui;
- set_tooltip(_("Preview"));
+ this->avicon = avicon;
+ this->id = id;
+}
+
+int AVIconDrawingItem::handle_event()
+{
+ for( int i=0; i<AVICON_PLAY_MODES; ++i ) {
+ AVIconDrawingItem *item = (AVIconDrawingItem *) avicon->get_item(i);
+ item->set_checked(id == i);
+ }
+ AWindowGUI *agui = avicon->agui;
+ agui->stop_vicon_drawing();
+ agui->vicon_thread->set_view_popup(0);
+ agui->vicon_drawing = id;
+ agui->start_vicon_drawing();
+ return 1;
}
-void AVIconDrawing::calculate_geometry(AWindowGUI *agui, VFrame **images, int *ww, int *hh)
+AVIconDrawing::AVIconDrawing(AWindowGUI *agui, int x, int y, int w, const char *text)
+ : BC_PopupMenu(x-w, y, w, text, -1, 0, 4)
{
- int text_line = -1, toggle_x = -1, toggle_y = -1;
- int text_x = -1, text_y = -1, text_w = -1, text_h = -1;
- BC_Toggle::calculate_extents(agui, images, 1,
- &text_line, ww, hh, &toggle_x, &toggle_y,
- &text_x, &text_y, &text_w, &text_h, "", MEDIUMFONT);
+ this->agui = agui;
}
AVIconDrawing::~AVIconDrawing()
{
}
-int AVIconDrawing::handle_event()
+void AVIconDrawing::create_objects()
{
- agui->vicon_drawing = get_value();
- if( agui->vicon_drawing )
- agui->start_vicon_drawing();
- else
- agui->stop_vicon_drawing();
- return 1;
+ AVIconDrawingItem *item;
+ for( int i=0; i<AVICON_PLAY_MODES; ++i ) {
+ add_item(item = new AVIconDrawingItem(this, avicon_names[i], i));
+ item->set_checked(agui->vicon_drawing == i);
+ }
}
-
AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui)
: BC_MenuItem("","v",'v')
{
#define ASSET_VIEW_MEDIA_MAP 3
#define ASSET_VIEW_FULL 4
+#define AVICON_FULL_PLAY 0
+#define AVICON_MOUSE_OVER 1
+#define AVICON_SRC_TARGET 2
+#define AVICON_NO_PLAY 3
+#define AVICON_PLAY_MODES 4
+
class AWindowFolderItem : public BC_ListBoxItem
{
public:
AssetVIconThread(AWindowGUI *gui, Preferences *preferences);
~AssetVIconThread();
- void set_view_popup(AssetVIcon *v, int draw_mode=-1);
+ void set_view_popup(AssetVIcon *v, int draw_mode);
+ void set_view_popup(AssetVIcon *v);
ViewPopup *new_view_window();
void drawing_started();
void drawing_stopped();
int save_defaults(BC_Hash *defaults);
int load_defaults(BC_Hash *defaults);
void start_vicon_drawing();
- void stop_vicon_drawing();
+ int stop_vicon_drawing();
void close_view_popup();
void update_picon(Indexable *indexable);
int cycle_assetlist_format();
int idx;
};
-class AVIconDrawing : public BC_Toggle
+class AVIconDrawingItem : public BC_MenuItem
{
public:
- AWindowGUI *agui;
-
+ AVIconDrawingItem(AVIconDrawing *avicon, const char *text, int id);
int handle_event();
- static void calculate_geometry(AWindowGUI *agui, VFrame **images, int *ww, int *hh);
- AVIconDrawing(AWindowGUI *agui, int x, int y, VFrame **images);
+ AVIconDrawing *avicon;
+ int id;
+};
+
+class AVIconDrawing : public BC_PopupMenu
+{
+public:
+ AVIconDrawing(AWindowGUI *agui, int x, int y, int w, const char *text);
~AVIconDrawing();
+
+ void create_objects();
+ static const char *avicon_names[];
+
+ AWindowGUI *agui;
};
class AWindowView;
class AddTools;
class AddPluginItem;
+class AVIconDrawingItem;
class AVIconDrawing;
class AWindowListFormat;
class AWindowListSort;
int is_usr_mnt = get_udfs_mount(udfs, mopts, mntpt);
const char *exec_path = File::get_cinlib_path();
fprintf(fp,"#!/bin/bash -ex\n");
- fprintf(fp,"dir=`dirname $0`\n");
+ fprintf(fp,"sdir=`dirname $0`\n");
+ fprintf(fp,"dir=`cd \"$sdir\"; pwd`\n");
fprintf(fp,"PATH=$PATH:%s\n",exec_path);
fprintf(fp,"mkdir -p $dir/udfs\n");
fprintf(fp,"sz=`du -cb $dir/bd.m2ts* | tail -1 | sed -e 's/[ \t].*//'`\n");
canvas_subwindow = 0;
canvas_fullscreen = 0;
is_processing = 0;
+ is_fullscreen = 0;
cursor_inside = 0;
}
canvas_menu->use_vwindow();
}
+int Canvas::get_fullscreen()
+{
+ return is_fullscreen;
+}
+
+void Canvas::set_fullscreen(int value)
+{
+ is_fullscreen = value;
+}
+
// Get dimensions given a zoom
void Canvas::calculate_sizes(float aspect_ratio,
int output_w,
virtual void draw_overlays() {}
virtual void toggle_controls() {}
virtual int get_cwindow_controls() { return 0; }
- virtual int get_fullscreen() { return 0; }
- virtual void set_fullscreen(int value) {}
+ virtual int get_fullscreen();
+ virtual void set_fullscreen(int value);
int cursor_leave_event_base(BC_WindowBase *caller);
int cursor_enter_event_base(BC_WindowBase *caller);
// For cases where video is not enabled on the canvas but processing is
// occurring for a single frame, this causes the status to update.
int is_processing;
+ int is_fullscreen;
// Cursor is inside video surface
int cursor_inside;
int view_x;
break;
case 'f':
unlock_window();
- if(mwindow->session->cwindow_fullscreen)
+ if( canvas->get_fullscreen() )
canvas->stop_fullscreen();
else
canvas->start_fullscreen();
break;
case ESC:
unlock_window();
- if(mwindow->session->cwindow_fullscreen)
+ if( canvas->get_fullscreen() )
canvas->stop_fullscreen();
lock_window("CWindowGUI::keypress_event 4");
result = 1;
gui->draw_status(1);
}
-int CWindowCanvas::get_fullscreen()
-{
- return mwindow->session->cwindow_fullscreen;
-}
-
-void CWindowCanvas::set_fullscreen(int value)
-{
- mwindow->session->cwindow_fullscreen = value;
-}
-
-
void CWindowCanvas::update_zoom(int x, int y, float zoom)
{
use_scrollbars = mwindow->edl->session->cwindow_scrollbars;
int cursor_motion_event();
int button_press_event();
int button_release_event();
- int get_fullscreen();
- void set_fullscreen(int value);
int test_crop(int button_press, int &redraw);
int test_bezier(int button_press,
int &redraw,
}
fprintf(fp,"#!/bin/bash\n");
- fprintf(fp,"dir=`dirname $0`\n");
+ fprintf(fp,"sdir=`dirname $0`\n");
+ fprintf(fp,"dir=`cd \"$sdir\"; pwd`\n");
fprintf(fp,"echo \"running %s\"\n", script);
fprintf(fp,"\n");
const char *exec_path = File::get_cinlib_path();
bmin(video_length, audio_length) :
idxbl->have_video() ? video_length :
idxbl->have_audio() ? audio_length : 0;
- fprintf(fp," <vob file=\"%s", !file_seq ? "dvd.mpg" : idxbl->path);
+ fprintf(fp," <vob file=\"%s", !file_seq ? "$dir/dvd.mpg" : idxbl->path);
chapter = 0;
double vob_end = i+1>=total_idxbls ? total_length : vob_pos + length;
if( labeled ) {
}
BatchRenderJob *job = new DVD_BatchRenderJob(mwindow->preferences,
- use_labeled, use_farmed, use_standard, use_ffmpeg);
+ use_labeled, use_farmed, use_standard, 0);// use_ffmpeg);
jobs->append(job);
strcpy(&job->edl_path[0], xml_filename);
Asset *asset = job->asset;
sprintf(&asset->path[0],"%s/dvd.mpg", asset_dir);
asset->format = FILE_FFMPEG;
strcpy(asset->fformat, "dvd");
-
+// if there are many renderfarm jobs, then there are small audio fragments of
+// silence that are used at the end of a render to fill the last audio "block".
+// this extra data gradually skews the audio/video sync. Therefore, the audio
+// is not rendered muxed for ffmpeg, and is remuxed as with mjpeg rendering.
+// since this audio is in one file, the only fragment is at the end and is ok.
+#if 0
asset->audio_data = 1;
asset->channels = session->audio_channels;
asset->sample_rate = session->sample_rate;
asset->ff_video_bitrate = vid_bitrate;
asset->ff_video_quality = -1;
use_farmed = job->farmed;
+#else
+ asset->video_data = 1;
+ strcpy(asset->vcodec, "raw.dvd");
+ sprintf(&asset->path[0],"%s/dvd.m2v", asset_dir);
+ FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec);
+ FFMPEG::load_options(option_path, asset->ff_video_options,
+ sizeof(asset->ff_video_options));
+ asset->ff_video_bitrate = vid_bitrate;
+ asset->ff_video_quality = -1;
+ use_farmed = job->farmed;
+
+ job = new BatchRenderJob(mwindow->preferences, 0, 0);
+ jobs->append(job);
+ strcpy(&job->edl_path[0], xml_filename);
+ asset = job->asset;
+ sprintf(&asset->path[0],"%s/dvd.ac3", asset_dir);
+ asset->format = FILE_AC3;
+ asset->audio_data = 1;
+ asset->channels = session->audio_channels;
+ asset->sample_rate = session->sample_rate;
+ asset->ac3_bitrate = dvd_kaudio_rate;
+#endif
}
else {
sprintf(&asset->path[0],"%s/dvd.m2v", asset_dir);
cwindow_controls = 1;
trim_edits = 0;
current_tip = -1;
- cwindow_fullscreen = 0;
- rwindow_fullscreen = 0;
- vwindow_fullscreen = 0;
- zwindow_fullscreen = 0;
selected_zwindow = -1;
actual_frame_rate = 0;
title_bar_alpha = 0;
int menueffect_w, menueffect_h;
int transitiondialog_w, transitiondialog_h;
- int cwindow_fullscreen;
- int rwindow_fullscreen;
- int vwindow_fullscreen;
- int zwindow_fullscreen;
int selected_zwindow;
double actual_frame_rate;
void RecordMonitor::create_objects()
{
int min_w = 150;
- mwindow->session->rwindow_fullscreen = 0;
if( !record->default_asset->video_data )
min_w = MeterPanel::get_meters_width(mwindow->theme,
int RecordMonitorGUI::button_press_event()
{
- if(mwindow->session->rwindow_fullscreen && canvas && canvas->get_canvas())
+ if( canvas && canvas->get_fullscreen() && canvas->get_canvas())
return canvas->button_press_event_base(canvas->get_canvas());
if( get_buttonpress() == 2 ) {
window->resize_event(new_w, new_h);
}
-int RecordMonitorCanvas::get_fullscreen()
-{
- return mwindow->session->rwindow_fullscreen;
-}
-
-void RecordMonitorCanvas::set_fullscreen(int value)
-{
- mwindow->session->rwindow_fullscreen = value;
-}
-
int RecordMonitorCanvas::button_release_event()
{
int keypress_event();
int get_output_w();
int get_output_h();
- int get_fullscreen();
- void set_fullscreen(int value);
-
RecordMonitorGUI *window;
MWindow *mwindow;
render->total_rendered = 0;
- if( !render->result ) {
+ if( !render->result &&
+ ( strategy == SINGLE_PASS_FARM || strategy == FILE_PER_LABEL_FARM ) ) {
// Start dispatching external jobs
if( mwindow ) {
mwindow->gui->lock_window("Render::render 1");
printf("Render::render: starting render farm\n");
}
- if( strategy == SINGLE_PASS_FARM || strategy == FILE_PER_LABEL_FARM ) {
- farm_server = new RenderFarmServer(mwindow, render->packages,
- render->preferences, 1, &render->result,
- &render->total_rendered, render->counter_lock,
- render->default_asset, command->get_edl(), 0);
- render->result = farm_server->start_clients();
-
- if( render->result ) {
- if( mwindow ) {
- mwindow->gui->lock_window("Render::render 2");
- mwindow->gui->show_message(_("Failed to start render farm"),
- mwindow->theme->message_error);
- mwindow->gui->stop_hourglass();
- mwindow->gui->unlock_window();
- }
- else {
- printf("Render::render: Failed to start render farm\n");
- }
+ farm_server = new RenderFarmServer(mwindow, render->packages,
+ render->preferences, 1, &render->result,
+ &render->total_rendered, render->counter_lock,
+ render->default_asset, command->get_edl(), 0);
+ render->result = farm_server->start_clients();
+
+ if( render->result ) {
+ if( mwindow ) {
+ mwindow->gui->lock_window("Render::render 2");
+ mwindow->gui->show_message(_("Failed to start render farm"),
+ mwindow->theme->message_error);
+ mwindow->gui->stop_hourglass();
+ mwindow->gui->unlock_window();
+ }
+ else {
+ printf("Render::render: Failed to start render farm\n");
}
}
}
break;
case 'f':
unlock_window();
- if(mwindow->session->vwindow_fullscreen)
+ if( canvas->get_fullscreen() )
canvas->stop_fullscreen();
else
canvas->start_fullscreen();
break;
case ESC:
unlock_window();
- if(mwindow->session->vwindow_fullscreen)
+ if( canvas->get_fullscreen() )
canvas->stop_fullscreen();
lock_window("VWindowGUI::keypress_event 2");
break;
}
}
-int VWindowCanvas::get_fullscreen()
-{
- return mwindow->session->vwindow_fullscreen;
-}
-
-void VWindowCanvas::set_fullscreen(int value)
-{
- mwindow->session->vwindow_fullscreen = value;
-}
-
int need_overlays();
void draw_overlays();
void close_source();
- int get_fullscreen();
- void set_fullscreen(int value);
MWindow *mwindow;
VWindowGUI *gui;
int result = 1;
switch( key ) {
case 'f':
- if( mwindow->session->zwindow_fullscreen )
+ if( canvas->get_fullscreen() )
canvas->stop_fullscreen();
else
canvas->start_fullscreen();
break;
case ESC:
- if( mwindow->session->zwindow_fullscreen )
+ if( canvas->get_fullscreen() )
canvas->stop_fullscreen();
break;
default:
cvs->flash(flush);
}
-int ZWindowCanvas::get_fullscreen()
-{
- return mwindow->session->zwindow_fullscreen;
-}
-
-void ZWindowCanvas::set_fullscreen(int value)
-{
- mwindow->session->zwindow_fullscreen = value;
-}
-
void draw_refresh(int flush = 1);
void close_source();
- int get_fullscreen();
- void set_fullscreen(int value);
MWindow *mwindow;
ZWindowGUI *gui;
--- /dev/null
+rawvideo mpeg2video
+s 720x480
+r 30000/1001
+pix_fmt yuv420p
+g 18
+maxrate 9000000
+minrate 0
+bufsize 1835008
+packetsize 2048
#include <math.h>
#include <string.h>
-BC_Pan::BC_Pan(int x,
- int y,
- int virtual_r,
- float maxvalue,
- int total_values,
- int *value_positions,
- int stick_x,
- int stick_y,
- float *values)
+BC_Pan::BC_Pan(int x, int y, int virtual_r,
+ float maxvalue, int total_values, int *value_positions,
+ int stick_x, int stick_y, float *values)
: BC_SubWindow(x, y, -1, -1, -1)
{
this->virtual_r = virtual_r;
this->stick_x,
this->stick_y);
highlighted = 0;
- popup = 0;
active = 0;
+ temp_channel = 0;
+ rotater = 0;
+ popup = 0;
memset(images, 0, sizeof(BC_Pixmap*) * PAN_IMAGES);
}
BC_Pan::~BC_Pan()
{
-//printf("BC_Pan::~BC_Pan 1\n");
delete [] values;
-//printf("BC_Pan::~BC_Pan 1\n");
delete [] value_positions;
-//printf("BC_Pan::~BC_Pan 1\n");
delete [] value_x;
-//printf("BC_Pan::~BC_Pan 1\n");
delete [] value_y;
-//printf("BC_Pan::~BC_Pan 1\n");
- if(popup) delete popup;
-//printf("BC_Pan::~BC_Pan 1\n");
+ delete popup;
delete temp_channel;
-//printf("BC_Pan::~BC_Pan 1\n");
delete rotater;
- for(int i = 0; i < PAN_IMAGES; i++)
- if(images[i]) delete images[i];
+ for( int i=0; i<PAN_IMAGES; ++i )
+ delete images[i];
//printf("BC_Pan::~BC_Pan 2\n");
}
get_resources()->pan_data[PAN_CHANNEL]->get_h(),
get_resources()->pan_data[PAN_CHANNEL]->get_color_model(),
-1);
- rotater = new RotateFrame(1,
- get_resources()->pan_data[PAN_CHANNEL]->get_w(),
- get_resources()->pan_data[PAN_CHANNEL]->get_h());
draw(1, 0);
return 0;
}
int BC_Pan::deactivate()
{
- if(popup) delete popup;
- popup = 0;
+ delete popup; popup = 0;
+ delete rotater; rotater = 0;
active = 0;
return 0;
}
if (x < 0) x = 0;
}
+ rotater = new RotateFrame(1,
+ get_resources()->pan_data[PAN_CHANNEL]->get_w(),
+ get_resources()->pan_data[PAN_CHANNEL]->get_h());
+
delete popup;
popup = new BC_Popup(this, x, y,
images[PAN_POPUP]->get_w(),
int BC_PopupMenu::set_images(VFrame **data)
{
- BC_Resources *resources = get_resources();
for( int i=0; i<3; ++i ) {
delete images[i];
images[i] = new BC_Pixmap(parent_window, data[i], PIXMAP_ALPHA);
}
- if( w_argument >= 0 )
- w = w_argument + margin +
- resources->popupmenu_triangle_margin;
- else
- w = get_text_width(MEDIUMFONT, text) + margin +
- resources->popupmenu_triangle_margin;
-
+ w = w_argument > 0 ? w_argument :
+ calculate_w(margin, get_text_width(MEDIUMFONT, text), use_title);
h = images[BUTTON_UP]->get_h();
return 0;
}
-int BC_PopupMenu::calculate_w(int w_argument)
+int BC_PopupMenu::calculate_w(int margin, int text_width, int use_title)
+{
+ BC_Resources *resources = get_resources();
+ int l = margin >= 0 ? margin : resources->popupmenu_margin;
+ int r = use_title < 0 ? l : resources->popupmenu_triangle_margin;
+ return l + text_width + r;
+}
+
+int BC_PopupMenu::calculate_w(int text_width)
{
- return w_argument +
- BC_WindowBase::get_resources()->popupmenu_margin +
- BC_WindowBase::get_resources()->popupmenu_triangle_margin;
+ return calculate_w(-1, text_width, 0);
}
int BC_PopupMenu::calculate_h(VFrame **data)
int BC_PopupMenu::draw_face(int dx)
{
if( !use_title ) return 0;
- BC_Resources *resources = get_resources();
// Background
draw_top_background(parent_window, 0, 0, w, h);
// Overlay text
set_color(get_resources()->popup_title_text);
int offset = status == BUTTON_DN ? 1 : 0;
- int available_w = get_w() - margin*2 - resources->popupmenu_triangle_margin;
+ int available_w = get_w() - calculate_w(margin, 0, use_title);
+
if( !icon ) {
- set_font(MEDIUMFONT);
char truncated[BCTEXTLEN];
truncate_text(truncated, text, available_w);
-
+ set_font(MEDIUMFONT);
BC_WindowBase::draw_center_text(
dx + available_w/2 + margin + offset,
(int)((float)get_h()/2 + get_text_ascent(MEDIUMFONT)/2 - 2) + offset,
virtual ~BC_PopupMenu();
// Adds popupmenu_margin to width
- static int calculate_w(int w_argument);
+ static int calculate_w(int margin, int text_width, int use_title);
+ static int calculate_w(int text_width);
static int calculate_h(VFrame **data = 0);
virtual int handle_event() { return 0; };
virtual int draw_face(int dx);
int result;
XClientMessageEvent *ptr;
int cancel_resize, cancel_translation;
- const int debug = 0;
+ volatile static int debug = 0;
key_pressed = 0;
-//static const char *event_names[] = {
-// "Reply", "Error", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify",
-// "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose",
-// "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify",
-// "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify",
-// "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear",
-// "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify",
-// "GenericEvent", "LASTEvent",
-//};
-//
-//if(debug)
-//if(event->type != ClientMessage) {
-// printf("BC_WindowBase::dispatch_event %d %s %p %d (%s)\n",
-//__LINE__, title, event, event->type,
-// event->type>=0 && event->type<sizeof(event_names)/sizeof(event_names[0]) ?
-// event_names[event->type] : "Unknown");
-//}
+if( debug && event->type != ClientMessage ) {
+ static const char *event_names[] = {
+ "Reply", "Error", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify",
+ "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose",
+ "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify",
+ "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify",
+ "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear",
+ "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify",
+ "GenericEvent", "LASTEvent",
+ };
+ const int nevents = sizeof(event_names)/sizeof(event_names[0]);
+
+ printf("BC_WindowBase::dispatch_event %d %s %p %d (%s)\n", __LINE__,
+ title, event, event->type, event->type>=0 && event->type<nevents ?
+ event_names[event->type] : "Unknown");
+}
if( active_grab ) {
unlock_window();
this->wdw = wdw;
this->vw = vw; this->vh = vh;
this->view_w = view_w; this->view_h = view_h;
- this->view_win = 0; this->vicon = 0; this->viewing = 0;
+ this->view_win = 0; this->vicon = 0;
+ this->viewing = 0; this->solo = 0;
this->draw_x0 = 0; this->draw_x1 = wdw->get_w();
this->draw_y0 = 0; this->draw_y1 = wdw->get_h();
draw_lock = new Condition(0, "VIconThread::draw_lock", 1);
timer = new Timer();
this->refresh_rate = VICON_RATE;
+ this->draw_flash = 0;
+ this->seq_no = 0;
+ this->now = 0;
done = 0;
interrupted = -1;
stop_age = 0;
void VIconThread::set_view_popup(VIcon *vicon)
{
+ if( viewing == vicon && !this->vicon ) return;
this->vicon = vicon;
+ if( interrupted )
+ update_view(0);
+
}
void VIconThread::close_view_popup()
}
int VIconThread::
-update_view()
+update_view(int do_audio)
{
if( viewing ) viewing->stop_audio();
delete view_win; view_win = 0;
view_win->draw_vframe(viewing->frame());
view_win->flash(0);
view_win->show_window();
- vicon->start_audio();
+ if( do_audio ) vicon->start_audio();
}
wdw->set_active_subwindow(view_win);
return 1;
}
}
+int VIconThread::show_vicon(VIcon *next)
+{
+ now = timer->get_difference();
+ if( now >= draw_flash ) return 1;
+ draw(next);
+ if( !next->seq_no ) {
+ next->cycle_start = now;
+ if( next->playing_audio > 0 )
+ next->start_audio();
+ }
+ int64_t ref_no = (now - next->cycle_start) / 1000. * refresh_rate;
+ int count = ref_no - next->seq_no;
+ if( count < 1 ) count = 1;
+ ref_no = next->seq_no + count;
+ next->age = next->cycle_start + 1000. * ref_no / refresh_rate;
+ if( !next->set_seq_no(ref_no) )
+ next->age = now + 1000.;
+ return 0;
+}
+
void VIconThread::
run()
{
wdw->lock_window("BC_WindowBase::run 1");
drawing_started();
reset_images();
- int64_t seq_no = 0, now = 0;
- int64_t draw_flash = 1000 / refresh_rate;
+ draw_flash = 1000 / refresh_rate;
+ seq_no = 0; now = 0;
while( !interrupted ) {
if( viewing != vicon )
update_view();
- VIcon *next = low_vicon();
- while( next && next->age < draw_flash ) {
- now = timer->get_difference();
- if( now >= draw_flash ) break;
- draw(next);
- if( !next->seq_no ) {
- next->cycle_start = now;
- if( next->playing_audio > 0 )
- next->start_audio();
+ if( !solo ) {
+ VIcon *next = low_vicon();
+ while( next && next->age < draw_flash ) {
+ if( show_vicon(next) ) break;
+ add_vicon(next);
+ next = low_vicon();
}
- int64_t ref_no = (now - next->cycle_start) / 1000. * refresh_rate;
- int count = ref_no - next->seq_no;
- if( count < 1 ) count = 1;
- ref_no = next->seq_no + count;
- next->age = next->cycle_start + 1000. * ref_no / refresh_rate;
- if( !next->set_seq_no(ref_no) )
- next->age = now + 1000.;
+ if( !next ) break;
add_vicon(next);
- next = low_vicon();
+ if( draw_flash < now+1 )
+ draw_flash = now+1;
}
- if( !next ) break;
- add_vicon(next);
- if( draw_flash < now+1 )
- draw_flash = now+1;
+ else
+ show_vicon(solo);
wdw->unlock_window();
while( !interrupted ) {
now = timer->get_difference();
Timer *timer;
Condition *draw_lock;
ViewPopup *view_win;
- VIcon *viewing, *vicon;
+ VIcon *viewing, *vicon, *solo;
int vw, vh, view_w, view_h;
int draw_x0, draw_y0;
int draw_x1, draw_y1;
int img_dirty, win_dirty;
double refresh_rate;
+ int64_t now;
+ int64_t draw_flash;
int64_t stop_age;
+ int64_t seq_no;
ArrayList<VIcon *>t_heap;
VIcon *low_vicon();
void run();
void flash();
int draw(VIcon *vicon);
- int update_view();
+ int update_view(int do_audio=1);
void draw_images();
void start_drawing();
void stop_drawing();
int zoom_scale(int dir);
void close_view_popup();
void hide_vicons(int v=1);
+ int show_vicon(VIcon *next);
virtual ViewPopup *new_view_window();
virtual bool visible(VIcon *vicon, int x, int y);