add new tracks as master, update msg txt
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / trackpopup.C
index e914bf741491e2808243b86de959470c3332df14..077fa9cb23cd208ea90fe20feb77f9a35257f0c4 100644 (file)
@@ -216,10 +216,10 @@ int TrackPopupAddTrack::handle_event()
                mwindow->add_audio_track_entry(1, popup->track);
                break;
        case TRACK_VIDEO:
-               mwindow->add_video_track_entry(popup->track);
+               mwindow->add_video_track_entry(1, popup->track);
                break;
        case TRACK_SUBTITLE:
-               mwindow->add_subttl_track_entry(popup->track);
+               mwindow->add_subttl_track_entry(1, popup->track);
                break;
        }
        return 1;
@@ -332,7 +332,7 @@ void TrackUserTitleDialogThread::handle_done_event(int result)
        const char *text = window->title_text->get_text();
        int count = 0;
        for( Track *track=edl->tracks->first; track; track=track->next ) {
-               if( !track->record ) continue;
+               if( !track->is_armed() ) continue;
                for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
                        if( !edit->is_selected ) continue;
                        strcpy(edit->user_title, text);
@@ -454,10 +454,12 @@ TrackTitleColorPicker::~TrackTitleColorPicker()
 }
 void TrackTitleColorPicker::create_objects(ColorWindow *gui)
 {
+       gui->lock_window("TrackTitleColorPicker::create_objects");
        int y = gui->get_h() - BC_CancelButton::calculate_h() + yS(10);
        int x = gui->get_w() - BC_CancelButton::calculate_w() - xS(10);
        x -= BC_GenericButton::calculate_w(gui, _("default")) + xS(15);
        gui->add_subwindow(new TrackTitleColorDefault(this, x, y));
+       gui->unlock_window();
 }
 
 int TrackTitleColorPicker::handle_new_color(int color, int alpha)
@@ -472,7 +474,7 @@ void TrackTitleColorPicker::handle_done_event(int result)
                EDL *edl = popup->mwindow->edl;
                int count = 0;
                for( Track *track=edl->tracks->first; track; track=track->next ) {
-                       if( !track->record ) continue;
+                       if( !track->is_armed() ) continue;
                        for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
                                if( !edit->is_selected ) continue;
                                edit->color = color;
@@ -573,15 +575,16 @@ void TrackPopupShowWindow::create_objects()
        add_subwindow(title = new BC_Title(x, y, text));
        int x1 = x + title->get_w() + xS(10);
        int tw = get_w() - x1 - xS(20);
-       truncate_text(text, track->title, tw);
-       add_subwindow(new BC_Title(x1, y, text));
+       char *track_title = get_truncated_text(MEDIUMFONT, track->title, tw);
+       add_subwindow(new BC_Title(x1, y, track_title));
+       delete [] track_title;
        y += title->get_h() + 5;
        sprintf(text, _("Edit %d:"), track->edits->number_of(edit)+1);
        add_subwindow(title = new BC_Title(x, y, text));
-       char edit_title[BCTEXTLEN];
-       edit->get_title(edit_title);
-       truncate_text(text, edit_title, tw);
-       add_subwindow(new BC_Title(x1, y, text));
+       edit->get_title(text);
+       char *edit_title = get_truncated_text(MEDIUMFONT, text, tw);
+       add_subwindow(new BC_Title(x1, y, edit_title));
+       delete [] edit_title;
        y += title->get_h() + 5;
 
        EDLSession *session = mwindow->edl->session;