コード例 #1
0
void
ags_recall_lv2_run_finalize(GObject *gobject)
{
  AgsRecallLv2 *recall_lv2;
  AgsRecallLv2Run *recall_lv2_run;

  recall_lv2_run = AGS_RECALL_LV2_RUN(gobject);
  
  g_free(recall_lv2_run->lv2_handle);

  g_free(recall_lv2_run->output);
  g_free(recall_lv2_run->input);
    
  if(recall_lv2_run->atom_port != NULL){
    free(recall_lv2_run->atom_port);
  }

  if(recall_lv2_run->event_port != NULL){
    free(recall_lv2_run->event_port);
  }

  if(recall_lv2_run->event_buffer != NULL){
    free(recall_lv2_run->event_buffer);
  }

  if(recall_lv2_run->event_count != NULL){
    free(recall_lv2_run->event_count);
  }

  if(recall_lv2_run->route_lv2_audio_run != NULL){
    g_object_unref(recall_lv2_run->route_lv2_audio_run);
  }

  g_list_free_full(recall_lv2_run->note,
		   g_object_unref);

  if(recall_lv2_run->worker_handle != NULL){
    AgsReturnableThread *returnable_thread;

    g_object_get(recall_lv2_run->worker_handle,
		 "returnable-thread", &returnable_thread,
		 NULL);
    
    if(returnable_thread != NULL){
      ags_returnable_thread_unset_flags(returnable_thread, AGS_RETURNABLE_THREAD_IN_USE);

      ags_thread_stop((AgsThread *) returnable_thread);

      g_object_unref(returnable_thread);
    }
    
    g_object_unref(recall_lv2_run->worker_handle);
  }
  
  /* call parent */
  G_OBJECT_CLASS(ags_recall_lv2_run_parent_class)->finalize(gobject);
}
コード例 #2
0
/* The suite cleanup function.
 * Closes the temporary file used by the tests.
 * Returns zero on success, non-zero otherwise.
 */
int
ags_thread_test_clean_suite()
{
  ags_thread_stop(main_loop);
  g_object_unref(main_loop);
  
  g_object_unref(application_context);
  
  return(0);
}
コード例 #3
0
void
ags_soundcard_thread_stopped_all_callback(AgsAudioLoop *audio_loop,
				   AgsSoundcardThread *soundcard_thread)
{
  AgsSoundcard *soundcard;
  
  soundcard = AGS_SOUNDCARD(soundcard_thread->soundcard);

  if(ags_soundcard_is_playing(soundcard)){
    ags_thread_stop((AgsThread *) soundcard_thread);
  }
}
コード例 #4
0
ファイル: ags_config.c プロジェクト: weedlight/ags
/**
 * ags_config_set:
 * @config: the #AgsConfig
 * @group: the config group identifier
 * @key: the key of the property
 * @value: the value to set
 *
 * Set config by @group and @key, applying @value.
 *
 * Since: 0.4
 */
void
ags_config_set(AgsConfig *config, gchar *group, gchar *key, gchar *value)
{
  AgsMain *ags_main;
  gchar *old_value;
  GError *error;
  
  ags_main = config->ags_main;

  error = NULL;
  old_value = g_key_file_get_value(config->key_file, group, key, &error);

  if(error != NULL && old_value != NULL){
    g_free(old_value);
  }
  
  g_key_file_set_value(config->key_file, group, key, g_strdup(value));

  if(!strncmp(group,
	      ags_config_generic,
	      8)){
    if(!strncmp(key,
		"autosave-thread\0",
		15)){
      AgsAutosaveThread *autosave_thread;

      if(ags_main == NULL ||
	 ags_main->autosave_thread == NULL){
	return;
      }
      
      autosave_thread = ags_main->autosave_thread;

      if(!strncmp(value,
		  "true\0",
		  5)){
	ags_thread_start(autosave_thread);
      }else{
	ags_thread_stop(autosave_thread);
      }
    }
  }else if(!strncmp(group,
		    ags_config_thread,
		    7)){
    if(!strncmp(key,
		"model\0",
		6)){
      //TODO:JK: implement me
    }else if(!strncmp(key,
		      "lock-global\0",
		      11)){
      //TODO:JK: implement me
    }else if(!strncmp(key,
		      "lock-parent\0",
		      11)){
      //TODO:JK: implement me
    }
  }else if(!strncmp(group,
		    ags_config_devout,
		    7)){
    AgsDevout *devout;

    if(ags_main == NULL ||
       ags_main->devout == NULL){
      return;
    }

    devout = ags_main->devout->data;

    if(!strncmp(key,
		"samplerate\0",
		10)){    
      guint samplerate;

      samplerate = strtoul(value,
			   NULL,
			   10);

      g_object_set(G_OBJECT(devout),
		   "frequency\0", samplerate,
		   NULL);
    }else if(!strncmp(key,
		      "buffer-size\0",
		      11)){
      guint buffer_size;
    
      buffer_size = strtoul(value,
			    NULL,
			    10);

      g_object_set(G_OBJECT(devout),
		   "buffer-size\0", buffer_size,
		   NULL);
    }else if(!strncmp(key,
		      "pcm-channels\0",
		      12)){
      guint pcm_channels;

      pcm_channels = strtoul(value,
			     NULL,
			     10);
      
      g_object_set(G_OBJECT(devout),
		   "pcm-channels\0", pcm_channels,
		   NULL);
    }else if(!strncmp(key,
		      "dsp-channels\0",
		      12)){
      guint dsp_channels;

      dsp_channels = strtoul(value,
			     NULL,
			     10);
      
      g_object_set(G_OBJECT(devout),
		   "dsp-channels\0", dsp_channels,
		   NULL);
    }else if(!strncmp(key,
		      "alsa-handle\0",
		      11)){
      gchar *alsa_handle;
    
      alsa_handle = value;
      g_object_set(G_OBJECT(devout),
		   "device\0", alsa_handle,
		   NULL);
    }
  }
}