int x1 = 0;
int y1 = PatchGUI::update(x, y);
+ int y2 = y1 + mwindow->theme->fade_h;
if( fade ) {
- if( h - y1 < mwindow->theme->fade_h ) {
+ if( h < y2 ) {
delete fade;
fade = 0;
}
mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_AUDIO_FADE]);
}
}
- else
- if( h - y1 >= mwindow->theme->fade_h ) {
+ else if( h >= y2 ) {
patchbay->add_subwindow(fade = new AFadePatch(mwindow, this, x1+x, y1+y,
patchbay->get_w() - 10));
}
- y1 += mwindow->theme->fade_h;
+ if( fade )
+ y1 = y2;
+ y2 = y1 + mwindow->theme->meter_h;
if( meter ) {
- if( h - y1 < mwindow->theme->meter_h ) {
+ if( h < y2 ) {
delete meter; meter = 0;
}
}
- else
- if( h - y1 >= mwindow->theme->meter_h ) {
+ else if( h >= y2 ) {
patchbay->add_subwindow(meter = new AMeterPatch(mwindow, this, x1+x, y1+y));
}
- y1 += mwindow->theme->meter_h;
+ if( meter )
+ y1 = y2;
+ y2 = y1 + mwindow->theme->pan_h;
if( pan ) {
- if( h - y1 < mwindow->theme->pan_h ) {
+ if( h < y2 ) {
delete mix; mix = 0;
delete pan; pan = 0;
delete nudge; nudge = 0;
nudge->update();
}
}
- else
- if( h - y1 >= mwindow->theme->pan_h ) {
+ else if( h >= y2 ) {
patchbay->add_subwindow(mix = new AMixPatch(mwindow, this, x1+x, y1+y+5));
x1 += mix->get_w() + 10;
patchbay->add_subwindow(pan = new APanPatch(mwindow, this, x1+x, y1+y));
patchbay->add_subwindow(nudge = new NudgePatch(mwindow, this, x1+x, y1+y,
patchbay->get_w() - x1-x - 10));
}
- y1 += mwindow->theme->pan_h;
+ if( pan )
+ y1 = y2;
return y1;
}
int ATrack::vertical_span(Theme *theme)
{
int track_h = Track::vertical_span(theme);
- int patch_h = 0;
- if(expand_view)
- {
- patch_h += theme->title_h + theme->play_h + theme->fade_h + theme->meter_h + theme->pan_h;
- }
+ int patch_h = theme->title_h;
+ if( expand_view )
+ patch_h += theme->play_h + theme->fade_h + theme->meter_h + theme->pan_h;
return MAX(track_h, patch_h);
}
lock_window("CWindowGUI::keypress_event 1");
break;
case 'x':
+ if( ctrl_down() || shift_down() || alt_down() ) break;
unlock_window();
mwindow->gui->lock_window("CWindowGUI::keypress_event 2");
mwindow->cut();
}
int EditCut::keypress_event()
{
+ if( ctrl_down() || shift_down() || alt_down() )
+ return 0;
if( get_keypress() == 'x' )
return handle_event();
return 0;
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Commercial ( shift X )"));
+ set_tooltip(_("Commercial ( shift A )"));
}
EditCommercial::~EditCommercial()
{
}
int EditCommercial::keypress_event()
{
- if( get_keypress() == 'X' )
+ if( ctrl_down() || !shift_down() || alt_down() )
+ return 0;
+ if( get_keypress() == 'A' )
return handle_event();
return 0;
}
}
int EditUndo::keypress_event()
{
+ if( ctrl_down() || shift_down() || alt_down() )
+ return 0;
if( get_keypress() == 'z' )
return handle_event();
return 0;
}
int EditRedo::keypress_event()
{
+ if( ctrl_down() || !shift_down() || alt_down() )
+ return 0;
if( get_keypress() == 'Z' )
return handle_event();
return 0;
switch( ref ) {
case NONAUTOTOGGLES_CAMERA_XYZ:
camera_xyz = toggle;
- accel = _("SHF+F1");
+ accel = _("Shift-F1");
break;
case NONAUTOTOGGLES_PROJECTOR_XYZ:
projector_xyz = toggle;
- accel = _("SHF+F2");
+ accel = _("Shift-F2");
break;
}
if( accel ) {
float *buffer = 0;
int buffer_shared = 0;
int center_pixel = mwindow->edl->local_session->zoom_track / 2;
- if( mwindow->edl->session->show_titles )
+ if( edit->track->show_titles() )
center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
if( index_state->index_status == INDEX_BUILDING ) {
viewmenu->add_item(plugin_automation = new PluginAutomation(mwindow, "7"));
viewmenu->add_item(mask_automation = new ShowAutomation(mwindow, _("Mask"), "8", AUTOMATION_MASK));
viewmenu->add_item(speed_automation = new ShowAutomation(mwindow, _("Speed"), "9", AUTOMATION_SPEED));
- viewmenu->add_item(camera_x = new ShowAutomation(mwindow, _("Camera X"), "", AUTOMATION_CAMERA_X));
- viewmenu->add_item(camera_y = new ShowAutomation(mwindow, _("Camera Y"), "", AUTOMATION_CAMERA_Y));
- viewmenu->add_item(camera_z = new ShowAutomation(mwindow, _("Camera Z"), "", AUTOMATION_CAMERA_Z));
- viewmenu->add_item(project_x = new ShowAutomation(mwindow, _("Projector X"), "", AUTOMATION_PROJECTOR_X));
- viewmenu->add_item(project_y = new ShowAutomation(mwindow, _("Projector Y"), "", AUTOMATION_PROJECTOR_Y));
- viewmenu->add_item(project_z = new ShowAutomation(mwindow, _("Projector Z"), "", AUTOMATION_PROJECTOR_Z));
+ camera_x = new ShowAutomation(mwindow, _("Camera X"), "Ctl-Shift-X", AUTOMATION_CAMERA_X);
+ camera_x->set_ctrl(); camera_x->set_shift(); viewmenu->add_item(camera_x);
+ camera_y = new ShowAutomation(mwindow, _("Camera Y"), "Ctl-Shift-Y", AUTOMATION_CAMERA_Y);
+ camera_y->set_ctrl(); camera_y->set_shift(); viewmenu->add_item(camera_y);
+ camera_z = new ShowAutomation(mwindow, _("Camera Z"), "Ctl-Shift-Z", AUTOMATION_CAMERA_Z);
+ camera_z->set_ctrl(); camera_z->set_shift(); viewmenu->add_item(camera_z);
+ project_x = new ShowAutomation(mwindow, _("Projector X"), "Alt-Shift-X", AUTOMATION_PROJECTOR_X);
+ project_x->set_alt(); project_x->set_shift(); viewmenu->add_item(project_x);
+ project_y = new ShowAutomation(mwindow, _("Projector Y"), "Alt-Shift-Y", AUTOMATION_PROJECTOR_Y);
+ project_y->set_alt(); project_y->set_shift(); viewmenu->add_item(project_y);
+ project_z = new ShowAutomation(mwindow, _("Projector Z"), "Alt-Shift-Z", AUTOMATION_PROJECTOR_Z);
+ project_z->set_alt(); project_z->set_shift(); viewmenu->add_item(project_z);
add_menu(windowmenu = new BC_Menu(_("Window")));
windowmenu->add_item(show_vwindow = new ShowVWindow(mwindow));
CutDefaultKeyframe::CutDefaultKeyframe(MWindow *mwindow)
- : BC_MenuItem(_("Cut default keyframe"), _("Alt-X"), 'X')
+ : BC_MenuItem(_("Cut default keyframe"), _("Alt-x"), 'x')
{
set_alt();
this->mwindow = mwindow;
sync_parameters(CHANGE_PARAMS);
}
-//void MWindow::set_titles(int value)
-//{
-// edl->session->show_titles = value;
-// trackmovement(edl->local_session->track_start);
-//}
-
void MWindow::set_screens(int value)
{
screens = value;
void hide_gwindow();
int tile_windows(int window_config);
char *get_cwindow_display();
-// void set_titles(int value);
void set_screens(int value);
int asset_to_edl(EDL *new_edl,
Asset *new_asset,
int y1 = 0;
- if(x != this->x || y != this->y)
- {
- this->x = x;
- this->y = y;
+ if( x != this->x || y != this->y ) {
+ this->x = x; this->y = y;
- if(title)
- {
-TRACE("PatchGUI::reposition 1\n");
+ if( title )
title->reposition_window(title->get_x(), y1 + y, 0);
-TRACE("PatchGUI::reposition 2\n");
- }
+ if( expand )
+ expand->reposition_window(expand->get_x(), y1 + y);
y1 += mwindow->theme->title_h;
- if(play)
- {
-TRACE("PatchGUI::reposition 3\n");
+ if( play ) {
play->reposition_window(play->get_x(), y1 + y);
x1 += play->get_w();
-TRACE("PatchGUI::reposition 4\n");
record->reposition_window(record->get_x(), y1 + y);
x1 += record->get_w();
-TRACE("PatchGUI::reposition 5\n");
// automate->reposition_window(x1, y1 + y);
// x1 += automate->get_w();
gang->reposition_window(gang->get_x(), y1 + y);
x1 += gang->get_w();
-TRACE("PatchGUI::reposition 6\n");
draw->reposition_window(draw->get_x(), y1 + y);
x1 += draw->get_w();
-TRACE("PatchGUI::reposition 7\n");
mute->reposition_window(mute->get_x(), y1 + y);
x1 += mute->get_w();
-TRACE("PatchGUI::reposition 8\n");
-
- if(expand)
- {
-TRACE("PatchGUI::reposition 9\n");
-// VFrame **expandpatch_data = mwindow->theme->get_image_set("expandpatch_data");
-// int x = patchbay->get_w() - 10 - expandpatch_data[0]->get_w();
- expand->reposition_window(
- expand->get_x(),
- y1 + y);
-TRACE("PatchGUI::reposition 10\n");
- x1 += expand->get_w();
-TRACE("PatchGUI::reposition 11\n");
- }
}
y1 += mwindow->theme->play_h;
}
- else
- {
- y1 += mwindow->theme->title_h;
- y1 += mwindow->theme->play_h;
+ else {
+ if( title )
+ y1 += mwindow->theme->title_h;
+ if( play )
+ y1 += mwindow->theme->play_h;
}
return y1;
int x1 = 0;
//printf("PatchGUI::update 10\n");
- if(title)
- {
- if(h - y1 < 0)
- {
- delete title;
- title = 0;
+ int y2 = y1 + mwindow->theme->title_h;
+ if( title ) {
+ if( h < y2 ) {
+ delete title; title = 0;
+ delete expand; expand = 0;
}
- else
- {
+ else {
title->update(track->title);
+ expand->update(track->expand_view);
}
}
- else
- if(h - y1 >= 0)
- {
- patchbay->add_subwindow(title = new TitlePatch(mwindow, this, x1 + x, y1 + y));
+ else if( h >= y2 ) {
+ VFrame **expandpatch_data = mwindow->theme->get_image_set("expandpatch_data");
+ int x2 = patchbay->get_w() - expandpatch_data[0]->get_w() - 5;
+ patchbay->add_subwindow(title = new TitlePatch(mwindow, this, x1 + x, y1 + y, x2-x1-5));
+ patchbay->add_subwindow(expand = new ExpandPatch(mwindow, this, x2, y1 + y));
}
- y1 += mwindow->theme->title_h;
- if(play)
- {
- if(h - y1 < mwindow->theme->play_h)
- {
+ if( title )
+ y1 = y2;
+
+ y2 = y1 + mwindow->theme->play_h;
+ if( play ) {
+ if( h < y2 ) {
delete play; play = 0;
delete record; record = 0;
delete gang; gang = 0;
delete draw; draw = 0;
delete mute; mute = 0;
- delete expand; expand = 0;
}
- else
- {
+ else {
play->update(track->play);
record->update(track->record);
gang->update(track->gang);
draw->update(track->draw);
mute->update(mwindow->get_int_auto(this, AUTOMATION_MUTE)->value);
- expand->update(track->expand_view);
}
}
- else
- if(h - y1 >= mwindow->theme->play_h)
- {
+ else if( h >= y2 ) {
patchbay->add_subwindow(play = new PlayPatch(mwindow, this, x1 + x, y1 + y));
//printf("PatchGUI::update %d %d\n", __LINE__, play->get_h());
x1 += play->get_w();
x1 += draw->get_w();
patchbay->add_subwindow(mute = new MutePatch(mwindow, this, x1 + x, y1 + y));
x1 += mute->get_w();
-
- VFrame **expandpatch_data = mwindow->theme->get_image_set("expandpatch_data");
- patchbay->add_subwindow(expand = new ExpandPatch(mwindow,
- this,
- patchbay->get_w() - 10 - expandpatch_data[0]->get_w(),
- y1 + y));
- x1 += expand->get_w();
}
- y1 += mwindow->theme->play_h;
+ if( play )
+ y1 = y2;
//UNTRACE
return y1;
}
-TitlePatch::TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
- : BC_TextBox(x, y, patch->patchbay->get_w() - 10, 1,
- patch->track->title, 1, MEDIUMFONT, 1)
+TitlePatch::TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, patch->track->title, 1, MEDIUMFONT, 1)
{
this->mwindow = mwindow;
this->patch = patch;
class TitlePatch : public BC_TextBox
{
public:
- TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
+ TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
int handle_event();
void update(const char *text);
MWindow *mwindow;
void ResourcePixmap::draw_data(TrackCanvas *canvas,
- Edit *edit,
- int64_t edit_x,
- int64_t edit_w,
- int64_t pixmap_x,
- int64_t pixmap_w,
- int64_t pixmap_h,
- int mode,
- int indexes_only)
+ Edit *edit, int64_t edit_x, int64_t edit_w,
+ int64_t pixmap_x, int64_t pixmap_w, int64_t pixmap_h,
+ int mode, int indexes_only)
{
// Get new areas to fill in relative to pixmap
// Area to redraw relative to pixmap
// if( mode == IGNORE_THREAD ) return;
int y = 0;
- if( mwindow->edl->session->show_titles )
+ if( edit->track->show_titles() )
y += mwindow->theme->get_image("title_bg_data")->get_h();
- Track *track = edit->edits->track;
// If want indexes only & index can't be drawn, don't do anything.
// Draw media which already exists
+ Track *track = edit->track;
if( track->draw ) {
switch( track->data_type )
{
break;
}
}
-
-// Draw title
-SET_TRACE
- if( mwindow->edl->session->show_titles )
- draw_title(canvas,
- edit,
- edit_x,
- edit_w,
- pixmap_x,
- pixmap_w);
SET_TRACE
}
w++;
Indexable *indexable = edit->get_source();
int center_pixel = mwindow->edl->local_session->zoom_track / 2;
- if( mwindow->edl->session->show_titles )
+ if( edit->track->show_titles() )
center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
int64_t scale_y = mwindow->edl->local_session->zoom_y;
int y_max = center_pixel + scale_y / 2 - 1;
canvas->test_timer();
}
-void ResourcePixmap::draw_wave(TrackCanvas *canvas, int x, double high, double low)
+void ResourcePixmap::draw_wave(TrackCanvas *canvas,
+ int x, double high, double low)
{
int top_pixel = 0;
if( mwindow->edl->session->show_titles )
- top_pixel = mwindow->theme->get_image("title_bg_data")->get_h();
+ top_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
int center_pixel = mwindow->edl->local_session->zoom_track / 2 + top_pixel;
int bottom_pixel = top_pixel + mwindow->edl->local_session->zoom_track;
int y1 = (int)(center_pixel -
if( frame_w < picon_w ) frame_w = picon_w;
// Current pixel relative to pixmap
int y = 0;
- if( mwindow->edl->session->show_titles )
+ if( edit->track->show_titles() )
y += mwindow->theme->get_image("title_bg_data")->get_h();
// Frame in project touched by current pixel
SEdit *sedit = (SEdit *)edit;
char *text = sedit->get_text();
if( !*text || w < 10 ) return;
- int center_pixel = mwindow->edl->local_session->zoom_track / 2;
- if( mwindow->edl->session->show_titles )
+ int center_pixel = canvas->resource_h() / 2;
+ if( edit->track->show_titles() )
center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
int64_t scale_y = mwindow->edl->local_session->zoom_y;
int x0 = edit_x;
class ResourcePixmap : public BC_Pixmap
{
public:
- ResourcePixmap(MWindow *mwindow,
- MWindowGUI *gui,
- Edit *edit,
- int pane_number,
- int w,
- int h);
+ ResourcePixmap(MWindow *mwindow, MWindowGUI *gui, Edit *edit,
+ int pane_number, int w, int h);
~ResourcePixmap();
void resize(int w, int h);
void draw_data(TrackCanvas *canvas,
- Edit *edit,
- int64_t edit_x,
- int64_t edit_w,
- int64_t pixmap_x,
- int64_t pixmap_w,
- int64_t pixmap_h,
- int mode,
- int indexes_only);
+ Edit *edit, int64_t edit_x, int64_t edit_w,
+ int64_t pixmap_x, int64_t pixmap_w, int64_t pixmap_h,
+ int mode, int indexes_only);
void draw_audio_resource(TrackCanvas *canvas,
- Edit *edit,
- int x,
- int w);
+ Edit *edit, int x, int w);
void draw_video_resource(TrackCanvas *canvas,
- Edit *edit,
- int64_t edit_x,
- int64_t edit_w,
- int64_t pixmap_x,
- int64_t pixmap_w,
- int refresh_x,
- int refresh_w,
+ Edit *edit, int64_t edit_x, int64_t edit_w,
+ int64_t pixmap_x, int64_t pixmap_w,
+ int refresh_x, int refresh_w,
int mode);
void draw_audio_source(TrackCanvas *canvas,
- Edit *edit,
- int x,
- int w);
+ Edit *edit, int x, int w);
void draw_subttl_resource(TrackCanvas *canvas,
- Edit *edit,
- int x,
- int w);
+ Edit *edit, int x, int w);
// Called by ResourceThread to update pixmap
void draw_wave(TrackCanvas *canvas,
- int x,
- double high,
- double low);
+ int x, double high, double low);
void draw_title(TrackCanvas *canvas,
- Edit *edit,
- int64_t edit_x,
- int64_t edit_w,
- int64_t pixmap_x,
- int64_t pixmap_w);
+ Edit *edit, int64_t edit_x, int64_t edit_w,
+ int64_t pixmap_x, int64_t pixmap_w);
void reset();
// Change to hourglass if timer expired
void test_timer();
int Track::vertical_span(Theme *theme)
{
int result = 0;
- if(expand_view)
- result = edl->local_session->zoom_track +
- plugin_set.total *
- theme->get_image("plugin_bg_data")->get_h();
- else
- result = edl->local_session->zoom_track;
-
- if(edl->session->show_titles)
+ if( show_titles() )
result += theme->get_image("title_bg_data")->get_h();
-
+ if( show_assets() )
+ result += edl->local_session->zoom_track;
+ if( expand_view )
+ result += plugin_set.total * theme->get_image("plugin_bg_data")->get_h();
+ result = MAX(result, theme->title_h);
return result;
}
return 0;
}
+int Track::show_assets()
+{
+ return expand_view || edl->session->show_assets ? 1 : 0;
+}
+
+int Track::show_titles()
+{
+ return expand_view || edl->session->show_titles ? 1 : 0;
+}
+int Track::show_transitions()
+{
+ return expand_view || edl->session->auto_conf->transitions ? 1 : 0;
+}
void Track::get_source_dimensions(double position, int &w, int &h)
{
int feather_edits(int64_t start, int64_t end, int64_t units);
int64_t get_feather(int64_t selectionstart, int64_t selectionend);
+ int show_assets();
+ int show_titles();
+ int show_transitions();
// Absolute number of this track
int number_of();
if(debug) PRINT_TRACE
- if(!mwindow->edl->session->show_assets) return;
-
-
// can't stop thread here, because this is called for every pane
// if(mode != IGNORE_THREAD && !indexes_only)
// gui->resource_thread->stop_draw(!indexes_only);
if(pixmap_w > pixmap->pixmap_w ||
pixmap_h > pixmap->pixmap_h)
pixmap->resize(pixmap_w, pixmap_h);
- pixmap->draw_data(this,
- edit,
- edit_x,
- edit_w,
- pixmap_x,
- pixmap_w,
- pixmap_h,
- mode,
- indexes_only);
+// Draw data
+ if( current->show_assets() )
+ pixmap->draw_data(this,
+ edit, edit_x, edit_w,
+ pixmap_x, pixmap_w, pixmap_h,
+ mode, indexes_only);
+ else {
+ set_bg_color(BLACK);
+ clear_box(0,0, pixmap_w,pixmap_h, pixmap);
+ }
+// Draw title
+ if( current->show_titles() )
+ pixmap->draw_title(this,
+ edit, edit_x, edit_w,
+ pixmap_x, pixmap_w);
// Resize it if it's smaller
if(pixmap_w < pixmap->pixmap_w ||
pixmap_h < pixmap->pixmap_h)
// }
pixmap_h = mwindow->edl->local_session->zoom_track;
- if(mwindow->edl->session->show_titles) pixmap_h += mwindow->theme->get_image("title_bg_data")->get_h();
+ Track *track = edit->edits->track;
+ if( track->show_titles() )
+ pixmap_h += mwindow->theme->get_image("title_bg_data")->get_h();
//printf("get_pixmap_size %d %d %d %d\n", edit_x, edit_w, pixmap_x, pixmap_w);
}
void TrackCanvas::edit_dimensions(Edit *edit,
- int64_t &x,
- int64_t &y,
- int64_t &w,
- int64_t &h)
+ int64_t &x, int64_t &y, int64_t &w, int64_t &h)
{
-// w = Units::round(edit->track->from_units(edit->length) *
-// mwindow->edl->session->sample_rate /
-// mwindow->edl->local_session->zoom_sample);
-
- h = resource_h();
-
x = Units::round(edit->track->from_units(edit->startproject) *
mwindow->edl->session->sample_rate /
mwindow->edl->local_session->zoom_sample -
mwindow->edl->local_session->view_start[pane->number]);
+ y = edit->edits->track->y_pixel - mwindow->edl->local_session->track_start[pane->number];
+
// Method for calculating w so when edits are together we never get off by one error due to rounding
int64_t x_next = Units::round(edit->track->from_units(edit->startproject + edit->length) *
mwindow->edl->session->sample_rate /
mwindow->edl->local_session->view_start[pane->number]);
w = x_next - x;
- y = edit->edits->track->y_pixel - mwindow->edl->local_session->track_start[pane->number];
-
- if(mwindow->edl->session->show_titles)
- h += mwindow->theme->get_image("title_bg_data")->get_h();
+ int edit_h = 0;
+ if( edit->track->show_titles() )
+ edit_h += mwindow->theme->get_image("title_bg_data")->get_h();
+ if( edit->track->show_assets() )
+ edit_h += resource_h();
+ h = edit_h;
}
void TrackCanvas::track_dimensions(Track *track, int64_t &x, int64_t &y, int64_t &w, int64_t &h)
w = Units::round(plugin->track->from_units(plugin->length) *
mwindow->edl->session->sample_rate /
mwindow->edl->local_session->zoom_sample);
- y = plugin->track->y_pixel -
- mwindow->edl->local_session->track_start[pane->number] +
- mwindow->edl->local_session->zoom_track +
- plugin->plugin_set->get_number() *
- mwindow->theme->get_image("plugin_bg_data")->get_h();
- if(mwindow->edl->session->show_titles)
+ y = plugin->track->y_pixel
+ - mwindow->edl->local_session->track_start[pane->number];
+ if( plugin->track->show_titles() )
y += mwindow->theme->get_image("title_bg_data")->get_h();
+ if( plugin->track->show_assets() )
+ y += resource_h();
+ y += plugin->plugin_set->get_number() *
+ mwindow->theme->get_image("plugin_bg_data")->get_h();
h = mwindow->theme->get_image("plugin_bg_data")->get_h();
}
edit_dimensions(edit, x, y, w, h);
- if(mwindow->edl->session->show_titles)
- {
+ if( edit->track->show_titles() )
y += mwindow->theme->get_image("title_bg_data")->get_h();
- }
- else
- {
- y = 0;
- }
if(side == EDIT_OUT)
- {
x += w - handle_w;
- }
h = handle_h;
w = handle_w;
}
-void TrackCanvas::get_transition_coords(int64_t &x, int64_t &y, int64_t &w, int64_t &h)
+void TrackCanvas::get_transition_coords(Edit *edit,
+ int64_t &x, int64_t &y, int64_t &w, int64_t &h)
{
-//printf("TrackCanvas::get_transition_coords 1\n");
-// int transition_w = mwindow->theme->transitionhandle_data[0]->get_w();
-// int transition_h = mwindow->theme->transitionhandle_data[0]->get_h();
- int transition_w = 30;
- int transition_h = 30;
-//printf("TrackCanvas::get_transition_coords 1\n");
-
- if(mwindow->edl->session->show_titles)
+ int transition_w = 30, transition_h = 30;
+
+ if( edit->track->show_titles() )
y += mwindow->theme->get_image("title_bg_data")->get_h();
-//printf("TrackCanvas::get_transition_coords 2\n");
+ if( edit->track->show_assets() )
+ y += resource_h() / 2;
- y += (h - mwindow->theme->get_image("title_bg_data")->get_h()) / 2 - transition_h / 2;
x -= transition_w / 2;
-
- h = transition_h;
+ y -= transition_h / 2;
w = transition_w;
+ h = transition_h;
}
void TrackCanvas::draw_highlighting()
//printf("TrackCanvas::draw_highlighting 1 %p %p\n",
// mwindow->session->track_highlighted, mwindow->session->edit_highlighted);
if(mwindow->session->edit_highlighted) {
-//printf("TrackCanvas::draw_highlighting 2\n");
if((mwindow->session->current_operation == DRAG_ATRANSITION &&
mwindow->session->track_highlighted->data_type == TRACK_AUDIO) ||
(mwindow->session->current_operation == DRAG_VTRANSITION &&
mwindow->session->track_highlighted->data_type == TRACK_VIDEO)) {
-//printf("TrackCanvas::draw_highlighting 2\n");
- edit_dimensions(mwindow->session->edit_highlighted, x, y, w, h);
-//printf("TrackCanvas::draw_highlighting 2\n");
-
+ edit_dimensions(mwindow->session->edit_highlighted,
+ x, y, w, h);
if(MWindowGUI::visible(x, x + w, 0, get_w()) &&
MWindowGUI::visible(y, y + h, 0, get_h())) {
draw_box = 1;
- get_transition_coords(x, y, w, h);
+ get_transition_coords(mwindow->session->edit_highlighted,
+ x, y, w, h);
}
-//printf("TrackCanvas::draw_highlighting 3\n");
}
}
break;
int current_show = 0;
int current_preset = 0;
-// if(!mwindow->edl->session->show_assets) goto done;
-
for(int i = 0; i < plugin_on_toggles.total; i++)
plugin_on_toggles.values[i]->in_use = 0;
for(int i = 0; i < plugin_show_toggles.total; i++)
{
int64_t x, y, w, h;
-// if(!mwindow->edl->session->show_assets) return;
-
for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
for(Edit *edit = track->edits->first; edit; edit = edit->next) {
if( !edit->hard_left && !edit->hard_right ) continue;
edit_dimensions(edit, x, y, w, h);
set_color(GREEN);
- set_opaque(); int y1 = y+h-1;
+ set_opaque();
+ int y1 = y;
+ if( track->show_titles() )
+ y1 += mwindow->theme->get_image("title_bg_data")->get_h();
+ if( track->show_assets() )
+ y1 += resource_h();
+ if( y1 == y )
+ y1 += mwindow->theme->title_h;
if( edit->hard_left ) {
ArrayList<int> xpt, ypt;
xpt.append(x); ypt.append(y1);
{
int64_t x, y, w, h;
-// if(!mwindow->edl->session->show_assets) return;
-
for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
+ if( !track->show_transitions() ) continue;
+
for(Edit *edit = track->edits->first; edit; edit = edit->next) {
if(!edit->transition) continue;
edit_dimensions(edit, x, y, w, h);
int strip_x = x, strip_y = y;
- if(mwindow->edl->session->show_titles)
+ if( track->show_titles() )
strip_y += mwindow->theme->get_image("title_bg_data")->get_h();
- get_transition_coords(x, y, w, h);
+ get_transition_coords(edit, x, y, w, h);
int strip_w = Units::round(edit->track->from_units(edit->transition->length) *
mwindow->edl->session->sample_rate / mwindow->edl->local_session->zoom_sample);
if( MWindowGUI::visible(x, x + w, 0, get_w()) &&
}
}
- if(!result &&
- session->auto_conf->plugins /* &&
- mwindow->edl->session->show_assets */) {
+ if(!result && session->auto_conf->plugins) {
Plugin *plugin;
KeyFrame *keyframe;
result = do_plugin_autos(track, cursor_x, cursor_y,
mwindow->edl->local_session->zoom_sample /
mwindow->edl->session->sample_rate;
unit_end = track->to_doubleunits(view_end);
- yscale = mwindow->edl->local_session->zoom_track;
-//printf("TrackCanvas::calculate_viewport yscale=%.0f\n", yscale);
- center_pixel = (int)(track->y_pixel -
- mwindow->edl->local_session->track_start[pane->number] +
- yscale / 2) +
- (mwindow->edl->session->show_titles ?
- mwindow->theme->get_image("title_bg_data")->get_h() :
- 0);
+ yscale = resource_h();
+ center_pixel = track->y_pixel
+ - mwindow->edl->local_session->track_start[pane->number];
+ if( track->show_assets() )
+ center_pixel += yscale / 2;
+ if( track->show_titles() )
+ center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
zoom_sample = mwindow->edl->local_session->zoom_sample;
zoom_units = track->to_doubleunits(zoom_sample / mwindow->edl->session->sample_rate);
for(int i = 0; i < track->plugin_set.total && !result; i++)
{
PluginSet *plugin_set = track->plugin_set.values[i];
- int center_pixel = (int)(track->y_pixel -
- mwindow->edl->local_session->track_start[pane->number] +
- mwindow->edl->local_session->zoom_track +
- (i + 0.5) * mwindow->theme->get_image("plugin_bg_data")->get_h() +
- (mwindow->edl->session->show_titles ? mwindow->theme->get_image("title_bg_data")->get_h() : 0));
+ int center_pixel = track->y_pixel -
+ mwindow->edl->local_session->track_start[pane->number];
+ if( track->show_titles() )
+ center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
+ if( track->show_assets() )
+ center_pixel += resource_h();
+ center_pixel += (i + 0.5) * mwindow->theme->get_image("plugin_bg_data")->get_h();
for(Plugin *plugin = (Plugin*)plugin_set->first;
plugin && !result;
draw_inout_points();
// Transitions
- if(mwindow->edl->session->auto_conf->transitions) draw_transitions();
+ draw_transitions();
// Plugins
draw_plugins();
int handle_result = -1;
int result = 0;
- if( !mwindow->edl->session->show_assets ) return 0;
-
for( Track *track=mwindow->edl->tracks->first; track && !result; track=track->next) {
+ if( !track->show_assets() ) continue;
+
for( Edit *edit=track->edits->first; edit && !result; edit=edit->next ) {
int64_t edit_x, edit_y, edit_w, edit_h;
edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
int handle_result = 0;
int result = 0;
-// if(!mwindow->edl->session->show_assets) return 0;
-
for(Track *track = mwindow->edl->tracks->first;
track && !result;
track = track->next) {
{
int result = 0;
-// if(!mwindow->edl->session->show_assets) return 0;
-
for(Track *track = mwindow->edl->tracks->first;
track && !result;
track = track->next) {
{
int result = 0;
- if(!mwindow->edl->session->show_assets) return 0;
-
for(Track *track = mwindow->edl->tracks->first; track && !result; track = track->next) {
+ if( !track->show_assets() ) continue;
for(Edit *edit = track->edits->first; edit && !result; edit = edit->next) {
int64_t edit_x, edit_y, edit_w, edit_h;
int64_t x, y, w, h;
Track *track = 0;
-
-// if(!mwindow->edl->session->show_assets) return 0;
-
-
for(track = mwindow->edl->tracks->first; track && !done; track = track->next) {
if(!track->expand_view) continue;
int result = 0;
int64_t x, y, w, h;
- if(/* !mwindow->edl->session->show_assets || */
- !mwindow->edl->session->auto_conf->transitions) return 0;
for( Track *track = mwindow->edl->tracks->first; track && !result; track = track->next ) {
+ if( !track->show_transitions() ) continue;
for( Edit *edit = track->edits->first; edit; edit = edit->next ) {
if( edit->transition ) {
edit_dimensions(edit, x, y, w, h);
- get_transition_coords(x, y, w, h);
+ get_transition_coords(edit, x, y, w, h);
if( MWindowGUI::visible(x, x + w, 0, get_w()) &&
MWindowGUI::visible(y, y + h, 0, get_h()) ) {
void draw_overlays();
void update_handles();
// Convert edit coords to transition coords
- void get_transition_coords(int64_t &x, int64_t &y, int64_t &w, int64_t &h);
+ void get_transition_coords(Edit *edit,
+ int64_t &x, int64_t &y, int64_t &w, int64_t &h);
void get_handle_coords(Edit *edit,
int64_t &x,
int64_t &y,
{
int64_t edit_x, edit_y, edit_w, edit_h;
trackcanvas->edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
- trackcanvas->get_transition_coords(edit_x, edit_y, edit_w, edit_h);
+ trackcanvas->get_transition_coords(edit, edit_x, edit_y, edit_w, edit_h);
if(visible(edit_x, edit_w, edit_y, edit_h))
{
{
set_checked(get_checked() ^ 1);
mwindow->edl->session->show_assets = get_checked();
- mwindow->gui->update(1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0);
+ mwindow->gui->update(1, 1, 0, 0, 1, 0, 0);
mwindow->gui->unlock_window();
mwindow->gwindow->gui->update_toggles(1);
mwindow->gui->lock_window("ShowAssets::handle_event");
{
set_checked(get_checked() ^ 1);
mwindow->edl->session->show_titles = get_checked();
- mwindow->gui->update(1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0);
+ mwindow->gui->update(1, 1, 0, 0, 1, 0, 0);
mwindow->gui->unlock_window();
mwindow->gwindow->gui->update_toggles(1);
mwindow->gui->lock_window("ShowTitles::handle_event");
const char *text,
const char *hotkey,
int subscript)
- : BC_MenuItem(text, hotkey, hotkey[0])
+ : BC_MenuItem(text, hotkey, hotkey[strlen(hotkey)-1])
{
this->mwindow = mwindow;
this->subscript = subscript;
int x1 = 0;
int y1 = PatchGUI::update(x, y);
+ int y2 = y1 + mwindow->theme->fade_h;
if( fade ) {
- if( h - y1 < mwindow->theme->fade_h ) {
- delete fade;
- fade = 0;
+ if( h < y2 ) {
+ delete fade; fade = 0;
}
else {
fade->update(fade->get_w(), mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(),
mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_VIDEO_FADE]);
}
}
- else
- if( h - y1 >= mwindow->theme->fade_h ) {
+ else if( h >= y2 ) {
patchbay->add_subwindow(fade = new VFadePatch(mwindow, this, x1+x, y1+y,
patchbay->get_w() - 10));
}
- y1 += mwindow->theme->fade_h;
+ if( fade )
+ y1 = y2;
+ y2 = y1 + mwindow->theme->mode_h;
if( mode ) {
- if( h - y1 < mwindow->theme->mode_h ) {
+ if( h < y2 ) {
delete mix; mix = 0;
delete mode; mode = 0;
delete nudge; nudge = 0;
nudge->update();
}
}
- else
- if( h - y1 >= mwindow->theme->mode_h ) {
+ else if( h >= y2 ) {
patchbay->add_subwindow(mix = new VMixPatch(mwindow, this, x1+x, y1+y+5));
x1 += mix->get_w();
patchbay->add_subwindow(mode = new VModePatch(mwindow, this, x1+x, y1+y));
patchbay->add_subwindow(nudge = new NudgePatch(mwindow, this, x1+x, y1+y,
patchbay->get_w() - x1-x - 10));
}
+ if( mode )
+ y1 = y2;
- y1 += mwindow->theme->mode_h;
return y1;
}
-
void VPatchGUI::synchronize_fade(float value_change)
{
if( fade && !change_source ) {
int VTrack::vertical_span(Theme *theme)
{
int track_h = Track::vertical_span(theme);
- int patch_h = 0;
- if(expand_view)
- {
- patch_h += theme->title_h + theme->play_h + theme->fade_h + theme->mode_h;
- }
+ int patch_h = theme->title_h;
+ if( expand_view )
+ patch_h += theme->play_h + theme->fade_h + theme->mode_h;
return MAX(track_h, patch_h);
}