Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / cwindow.C
index d4047e3564bd3c006bcdf3c2b15dc7004d731723..9416cee9ba6b3b4735814495e427b5ed6cc6dc63 100644 (file)
@@ -124,7 +124,7 @@ Track* CWindow::calculate_affected_track()
        Track *track = mwindow->edl->tracks->first;
        for( ; track; track=track->next ) {
                if( track->data_type != TRACK_VIDEO ) continue;
-               if( track->record ) break;
+               if( track->is_armed() ) break;
        }
        return track;
 }
@@ -134,7 +134,7 @@ Track* CWindow::calculate_mask_track()
        Track *track = mwindow->edl->tracks->first;
        for( ; track; track=track->next ) {
                if( track->data_type != TRACK_VIDEO ) continue;
-               if( track->record && track->get_id() == mask_track_id ) break;
+               if( track->is_armed() && track->get_id() == mask_track_id ) break;
        }
        return track;
 }
@@ -190,7 +190,8 @@ void CWindow::calculate_affected_autos(Track *track,
        if( y_auto )
                *y_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iy],
                                create_y, &y_created, redraw);
-       if( z_auto ) *z_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iz],
+       if( z_auto )
+               *z_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iz],
                                create_z, &z_created, redraw);
 }
 
@@ -269,36 +270,42 @@ void CWindow::refresh_frame(int change_type, int dir)
        refresh_frame(change_type, mwindow->edl, dir);
 }
 
-CWindowRemoteHandler::
-CWindowRemoteHandler(RemoteControl *remote_control)
+CWindowKeyEvHandler::
+CWindowKeyEvHandler(RemoteControl *remote_control)
  : RemoteHandler(remote_control->gui, RED)
 {
+       this->remote_control = remote_control;
+       this->mwindow = remote_control->mwindow_gui->mwindow;
        last_key = -1;
+       key = -1;
 }
 
-CWindowRemoteHandler::
-~CWindowRemoteHandler()
+CWindowKeyEvHandler::
+~CWindowKeyEvHandler()
 {
 }
 
-int CWindowRemoteHandler::remote_process_key(RemoteControl *remote_control, int key)
+int CWindowKeyEvHandler::remote_key(int key)
 {
-       MWindowGUI *mwindow_gui = remote_control->mwindow_gui;
-       EDL *edl = mwindow_gui->mwindow->edl;
+       return remote_process_key(remote_control, key);
+}
+
+int CWindowKeyEvHandler::remote_process_key(RemoteControl *remote_control, int key)
+{
+       EDL *edl = mwindow->edl;
        if( !edl ) return 0;
-       PlayTransport *transport = mwindow_gui->mbuttons->transport;
+       PlayTransport *transport = mwindow->gui->mbuttons->transport;
        if( !transport->get_edl() ) return 0;
        PlaybackEngine *engine = transport->engine;
        double position = engine->get_tracking_position();
        double length = edl->tracks->total_length();
-       int next_command = -1, lastkey = last_key;
-       last_key = key;
+       int next_command = -1;
 
        switch( key ) {
        case '1': case '2': case '3': case '4':
        case '5': case '6': case '7': case '8':
-               if( lastkey == 'e' ) {
-                       mwindow_gui->mwindow->select_asset(key-'1', 1);
+               if( last_key == 'e' ) {
+                       mwindow->select_asset(key-'1', 1);
                        break;
                } // fall through
        case '0': case '9':
@@ -316,19 +323,14 @@ int CWindowRemoteHandler::remote_process_key(RemoteControl *remote_control, int
        case KPRECD:  next_command = SLOW_REWIND;       break;
        case KPAUSE:  next_command = SLOW_FWD;          break;
        case ' ':  next_command = NORMAL_FWD;           break;
-       case 'a':  gui->tile_windows(0);                return 1;
-       case 'b':  gui->tile_windows(1);                return 1;
-       case 'c':  gui->tile_windows(2);                return 1;
-#ifdef HAVE_DVB
-       case 'd':
-               mwindow_gui->channel_info->toggle_scan();
-               return 1;
-#endif
-       case 'e':
-               break;
+       case 'a':  remote_control->gui->tile_windows(0);  return 1;
+       case 'b':  remote_control->gui->tile_windows(1);  return 1;
+       case 'c':  remote_control->gui->tile_windows(2);  return 1;
+       case KPFSCRN:
        case 'f': {
-               Canvas *canvas = mwindow_gui->mwindow->cwindow->gui->canvas;
-               canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
+               CWindowCanvas *canvas = mwindow->cwindow->gui->canvas;
+               int on = canvas->get_fullscreen() ? 0 : 1;
+               canvas->Canvas::set_fullscreen(on, 0);
                return 1; }
        default:
                return -1;