Esempio n. 1
0
void i_configure_cfg_ap_save( void )
{
  pcfg_t *cfgfile;
  gchar *config_pathfilename = i_configure_cfg_get_file();
  cfgfile = i_pcfg_new_from_file( config_pathfilename );

  if (!cfgfile)
    cfgfile = i_pcfg_new();

  /* save amidi-plug config information */
  i_pcfg_write_string( cfgfile , "general" , "ap_seq_backend" ,
                       amidiplug_cfg_ap.ap_seq_backend );
  i_pcfg_write_integer( cfgfile , "general" , "ap_opts_transpose_value" ,
                        amidiplug_cfg_ap.ap_opts_transpose_value );
  i_pcfg_write_integer( cfgfile , "general" , "ap_opts_drumshift_value" ,
                        amidiplug_cfg_ap.ap_opts_drumshift_value );
  i_pcfg_write_integer( cfgfile , "general" , "ap_opts_length_precalc" ,
                        amidiplug_cfg_ap.ap_opts_length_precalc );
  i_pcfg_write_integer( cfgfile , "general" , "ap_opts_lyrics_extract" ,
                        amidiplug_cfg_ap.ap_opts_lyrics_extract );
  i_pcfg_write_integer( cfgfile , "general" , "ap_opts_comments_extract" ,
                        amidiplug_cfg_ap.ap_opts_comments_extract );

  i_pcfg_write_to_file( cfgfile , config_pathfilename );
  i_pcfg_free( cfgfile );
  g_free( config_pathfilename );
}
Esempio n. 2
0
void i_configure_cfg_backend_read( void )
{
  pcfg_t *cfgfile;
  gchar *config_pathfilename = i_configure_cfg_get_file();

  cfgfile = i_pcfg_new_from_file( config_pathfilename );

  i_configure_cfg_alsa_read( cfgfile ); /* get alsa backend configuration */
  i_configure_cfg_fsyn_read( cfgfile ); /* get fluidsynth backend configuration */

  if ( cfgfile != NULL )
    i_pcfg_free(cfgfile);

  g_free( config_pathfilename );
}
Esempio n. 3
0
void i_configure_cfg_backend_save( void )
{
  pcfg_t *cfgfile;
  gchar *config_pathfilename = i_configure_cfg_get_file();

  cfgfile = i_pcfg_new_from_file( config_pathfilename );

  if (!cfgfile)
    cfgfile = i_pcfg_new();

  i_configure_cfg_alsa_save( cfgfile ); /* save alsa backend configuration */
  i_configure_cfg_fsyn_save( cfgfile ); /* save fluidsynth backend configuration */

  i_pcfg_write_to_file( cfgfile , config_pathfilename );
  i_pcfg_free( cfgfile );
  g_free( config_pathfilename );
}
Esempio n. 4
0
void i_configure_cfg_backend_read( void )
{
  pcfg_t *cfgfile;
  gchar *config_pathfilename = i_configure_cfg_get_file();

  cfgfile = i_pcfg_new_from_file( config_pathfilename );

#ifdef AMIDIPLUG_ALSA
  i_configure_cfg_alsa_read( cfgfile ); /* get alsa backend configuration */
#endif
#ifdef AMIDIPLUG_FLUIDSYNTH
  i_configure_cfg_fsyn_read( cfgfile ); /* get fluidsynth backend configuration */
#endif

  if ( cfgfile != NULL )
    i_pcfg_free(cfgfile);

  g_free( config_pathfilename );
}
Esempio n. 5
0
void i_configure_cfg_backend_save( void )
{
  pcfg_t *cfgfile;
  gchar *config_pathfilename = i_configure_cfg_get_file();

  cfgfile = i_pcfg_new_from_file( config_pathfilename );

  if (!cfgfile)
    cfgfile = i_pcfg_new();

#ifdef AMIDIPLUG_ALSA
  i_configure_cfg_alsa_save( cfgfile ); /* save alsa backend configuration */
#endif
#ifdef AMIDIPLUG_FLUIDSYNTH
  i_configure_cfg_fsyn_save( cfgfile ); /* save fluidsynth backend configuration */
#endif

  i_pcfg_write_to_file( cfgfile , config_pathfilename );
  i_pcfg_free( cfgfile );
  g_free( config_pathfilename );
}
Esempio n. 6
0
/* read only the amidi-plug part of configuration */
void i_configure_cfg_ap_read( void )
{
  pcfg_t *cfgfile;
  gchar *config_pathfilename = i_configure_cfg_get_file();

  cfgfile = i_pcfg_new_from_file( config_pathfilename );

  if (!cfgfile)
  {
    /* amidi-plug defaults */

    amidiplug_cfg_ap.ap_seq_backend = g_strdup (DEFAULT_BACKEND);
    amidiplug_cfg_ap.ap_opts_transpose_value = 0;
    amidiplug_cfg_ap.ap_opts_drumshift_value = 0;
    amidiplug_cfg_ap.ap_opts_length_precalc = 0;
    amidiplug_cfg_ap.ap_opts_lyrics_extract = 0;
    amidiplug_cfg_ap.ap_opts_comments_extract = 0;
  }
  else
  {
    i_pcfg_read_string ( cfgfile , "general" , "ap_seq_backend" ,
                         &amidiplug_cfg_ap.ap_seq_backend, DEFAULT_BACKEND );
    i_pcfg_read_integer( cfgfile , "general" , "ap_opts_transpose_value" ,
                         &amidiplug_cfg_ap.ap_opts_transpose_value , 0 );
    i_pcfg_read_integer( cfgfile , "general" , "ap_opts_drumshift_value" ,
                         &amidiplug_cfg_ap.ap_opts_drumshift_value , 0 );
    i_pcfg_read_integer( cfgfile , "general" , "ap_opts_length_precalc" ,
                         &amidiplug_cfg_ap.ap_opts_length_precalc , 0 );
    i_pcfg_read_integer( cfgfile , "general" , "ap_opts_lyrics_extract" ,
                         &amidiplug_cfg_ap.ap_opts_lyrics_extract , 0 );
    i_pcfg_read_integer( cfgfile , "general" , "ap_opts_comments_extract" ,
                         &amidiplug_cfg_ap.ap_opts_comments_extract , 0 );
    i_pcfg_free( cfgfile );
  }

  g_free( config_pathfilename );
}