record = 0;
play = 0;
// automate = 0;
- gang = 0;
draw = 0;
mute = 0;
+ gang = 0;
+ master = 0;
zoom = 0;
expand = 0;
nudge = 0;
change_source = 0;
track_id = track ? track->get_id() : -1;
mixer = 0;
+ edge = 0;
+ span = 1;
}
PatchGUI::~PatchGUI()
delete record;
delete play;
// delete automate;
- delete gang;
delete draw;
delete mute;
+ delete gang;
+ delete master;
delete zoom;
delete expand;
delete nudge;
int PatchGUI::reposition(int x, int y)
{
+ if( track->is_hidden() ) return 0;
int x1 = 0;
int y1 = 0;
x1 += record->get_w();
// automate->reposition_window(x1, y1 + y);
// x1 += automate->get_w();
- gang->reposition_window(gang->get_x(), y1 + y);
- x1 += gang->get_w();
draw->reposition_window(draw->get_x(), y1 + y);
x1 += draw->get_w();
mute->reposition_window(mute->get_x(), y1 + y);
x1 += mute->get_w();
+ gang->reposition_window(gang->get_x(), y1 + y);
+ x1 += gang->get_w();
+ master->reposition_window(master->get_x(), y1 + y);
+ x1 += master->get_w();
zoom->reposition_window(zoom->get_x(), y1 + y);
+// x1 += zoom->get_w();
}
y1 += mwindow->theme->play_h;
}
int PatchGUI::update(int x, int y)
{
+ if( track->is_hidden() ) return 0;
//TRACE("PatchGUI::update 1");
reposition(x, y);
//TRACE("PatchGUI::update 10");
if( h < y2 ) {
delete play; play = 0;
delete record; record = 0;
- delete gang; gang = 0;
delete draw; draw = 0;
delete mute; mute = 0;
+ delete gang; gang = 0;
+ delete master; master = 0;
delete zoom; zoom = 0;
}
else {
play->update(track->play);
- record->update(track->record);
- gang->update(track->gang);
+ record->update(track->armed);
draw->update(track->draw);
mute->update(mwindow->get_int_auto(this, AUTOMATION_MUTE)->value);
+ gang->update(track->ganged);
+ master->update(track->master);
}
}
else if( h >= y2 ) {
x1 += play->get_w();
patchbay->add_subwindow(record = new RecordPatch(mwindow, this, x1 + x, y1 + y));
x1 += record->get_w();
- patchbay->add_subwindow(gang = new GangPatch(mwindow, this, x1 + x, y1 + y));
- x1 += gang->get_w();
patchbay->add_subwindow(draw = new DrawPatch(mwindow, this, x1 + x, y1 + y));
x1 += draw->get_w();
patchbay->add_subwindow(mute = new MutePatch(mwindow, this, x1 + x, y1 + y));
x1 += mute->get_w();
+ patchbay->add_subwindow(gang = new GangPatch(mwindow, this, x1 + x, y1 + y));
+ x1 += gang->get_w();
+ patchbay->add_subwindow(master = new MasterPatch(mwindow, this, x1 + x, y1 + y));
+ x1 += master->get_w();
patchbay->add_subwindow(zoom = new ZoomPatch(mwindow, this, x1 + x, y1 + y));
+// x1 += zoom->get_w();
}
if( play )
y1 = y2;
: BC_Toggle(x,
y,
mwindow->theme->get_image_set("recordpatch_data"),
- patch->track->record,
+ patch->track->armed,
"",
0,
0,
patch->toggle_behavior(Tracks::RECORD,
get_value(),
this,
- &patch->track->record);
- patch->title->set_back_color(patch->track->record ?
+ &patch->track->armed);
+ patch->title->set_back_color(patch->track->armed ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
patch->title->set_text_row(0);
GangPatch::GangPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
: BC_Toggle(x, y,
mwindow->theme->get_image_set("gangpatch_data"),
- patch->track->gang,
+ patch->track->ganged,
"",
0,
0,
patch->toggle_behavior(Tracks::GANG,
get_value(),
this,
- &patch->track->gang);
+ &patch->track->ganged);
return 1;
}
return 0;
}
+MasterPatch::MasterPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("masterpatch_data"),
+ patch->track->master, "", 0, 0, 0)
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Master Track"));
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Displaying tracks: Ganged mode");
+}
+
+int MasterPatch::handle_event()
+{
+ patch->track->master = patch->track->master ? 0 : 1;
+ mwindow->draw_trackmovement(); // delayed, can delete *this
+ return 1;
+}
+
+
ExpandPatch::ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
- : BC_Toggle(x,
- y,
- mwindow->theme->get_image_set("expandpatch_data"),
- patch->track->expand_view,
- "",
- 0,
- 0,
- 0)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("expandpatch_data"),
+ patch->track->expand_view, "", 0, 0, 0)
{
this->mwindow = mwindow;
this->patch = patch;
{
this->mwindow = mwindow;
this->patch = patch;
- set_back_color(patch->track->record ?
+ set_back_color(patch->track->armed ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
}
void TitlePatch::update(const char *text)
{
- set_back_color(patch->track->record ?
+ set_back_color(patch->track->armed ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
BC_TextBox::update(text);
mwindow->undo->update_undo_before(_("nudge."), this);
patch->track->nudge = value;
- if(patch->track->gang && patch->track->record)
+ if(patch->track->is_ganged() && patch->track->is_armed())
patch->patchbay->synchronize_nudge(patch->track->nudge, patch->track);
mwindow->undo->update_undo_after(_("nudge."), LOAD_PATCHES);