memory leaks and tweaks, sams histeq icon
[goodguy/history.git] / cinelerra-5.1 / cinelerra / vwindow.C
index d65fd59775f8a44cdcdb2a7503b709453ff87af8..8de4eb73170154add8af0a090bb621e81107e84c 100644 (file)
@@ -284,43 +284,6 @@ void VWindow::change_source(EDL *edl)
                gui->change_source(edl, _("Viewer"));
 }
 
-void VWindow::change_source(char *folder, int item)
-{
-//printf("VWindow::change_source %d\n", __LINE__);
-       int result = 0;
-       if(!running()) return;
-// Search EDLs
-       if(!strcasecmp(folder, CLIP_FOLDER))
-       {
-               if(item < mwindow->edl->clips.total)
-               {
-                       change_source(mwindow->edl->clips.values[item]);
-                       result = 1;
-               }
-       }
-       else
-// Search media
-       if(!strcasecmp(folder, MEDIA_FOLDER))
-       {
-               if(item < mwindow->edl->assets->total())
-               {
-                       change_source(mwindow->edl->assets->get_item_number(item));
-                       result = 1;
-               }
-       }
-       else
-// Search extra clip folders
-       {
-       }
-
-       if(!result)
-       {
-               delete_source(1, 1);
-       }
-}
-
-
-
 
 void VWindow::goto_start()
 {
@@ -365,29 +328,19 @@ void VWindow::update_position(int change_type,
        {
 //printf("VWindow::update_position %d\n", __LINE__);
 //edl->dump();
-               playback_engine->que->send_command(CURRENT_FRAME,
-                       change_type,
-                       edl,
-                       1);
+               playback_engine->refresh_frame(change_type, edl);
 
                double position = edl->local_session->get_selectionstart(1);
-               Asset *asset = edl->assets->first;
-               if( asset && asset->tcstart ) {
-                       double rate = asset->video_data ? asset->frame_rate :
-                               asset->audio_data ? asset->sample_rate : 0;
-                       if( rate > 0 )
-                               position += asset->tcstart / rate;
-               }
-
                if(lock_window) gui->lock_window("VWindow::update_position");
                gui->clock->update(position);
                if(lock_window) gui->unlock_window();
        }
 }
 
-
-
-
+void VWindow::stop_playback(int wait)
+{
+       playback_engine->stop_playback(wait);
+}
 
 int VWindow::update_position(double position)
 {
@@ -431,22 +384,12 @@ void VWindow::set_outpoint()
        }
 }
 
-void VWindow::clear_inpoint()
-{
-       EDL *edl = get_edl();
-       if(edl)
-       {
-               edl->local_session->unset_inpoint();
-               gui->timebar->update(1);
-       }
-}
-
-void VWindow::clear_outpoint()
+void VWindow::unset_inoutpoint()
 {
        EDL *edl = get_edl();
        if(edl)
        {
-               edl->local_session->unset_outpoint();
+               edl->unset_inoutpoint();
                gui->timebar->update(1);
        }
 }
@@ -470,10 +413,8 @@ void VWindow::copy()
                const char *file_string = file.string();
                long file_length = strlen(file_string);
                mwindow->gui->lock_window();
-               mwindow->gui->get_clipboard()->to_clipboard(file_string, file_length,
-                       SECONDARY_SELECTION);
-               mwindow->gui->get_clipboard()->to_clipboard(file_string, file_length,
-                       BC_PRIMARY_SELECTION);
+               mwindow->gui->to_clipboard(file_string, file_length, BC_PRIMARY_SELECTION);
+               mwindow->gui->to_clipboard(file_string, file_length, SECONDARY_SELECTION);
                mwindow->gui->unlock_window();
        }
 }