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;