~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/timer.c

  • Committer: Osmo Antero
  • Date: 2014-01-16 19:19:35 UTC
  • Revision ID: osmoma@gmail.com-20140116191935-gx20l1avchsc5m2d
Version 1.4-2. Ref. question #241801 Timer.c fails to start and stop recording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
922
922
 
923
923
    if (action == 0) return;
924
924
 
925
 
    // Check state of pipeline
 
925
    // Get state of pipeline
926
926
    gint state = -1;
927
927
    gint pending = -1;
928
928
    rec_manager_get_state(&state, &pending);
929
929
 
930
 
    // Pipeline is alive?
931
 
    if (state == GST_STATE_NULL && pending == GST_STATE_NULL) {
932
 
        return;
933
 
    }
934
 
 
935
930
    switch (action) {
936
931
    case 'S': // Start recording
937
932
        tr->done = TRUE;
 
933
 
 
934
        if (state == GST_STATE_PLAYING) {
 
935
            return;
 
936
        }
 
937
 
938
938
        rec_manager_start_recording();
939
939
        break;
940
940
 
941
941
    case 'T': // Stop recording
942
942
        tr->done = TRUE;
 
943
 
 
944
        if (state == GST_STATE_NULL && pending == GST_STATE_NULL) {
 
945
            return;
 
946
        }
 
947
 
943
948
        rec_manager_stop_recording();
944
949
        break;
945
950
 
946
951
    case 'P': // Pause recording
947
952
        tr->done = TRUE;
 
953
 
 
954
        if (state == GST_STATE_PAUSED) {
 
955
            return;
 
956
        }
 
957
 
948
958
        rec_manager_pause_recording();
949
959
        break;
950
960
 
951
961
    case 'p': // Pause recording
952
962
        tr->done = TRUE;
 
963
 
 
964
        if (state == GST_STATE_PAUSED) {
 
965
            return;
 
966
        }
 
967
 
953
968
        rec_manager_pause_recording();
954
969
        break;
955
970