Beispiel #1
0
void director::on_config_nudge (base::conf_node& node)
{
    string out;

    m_info.sample_rate  = node.child ("sample_rate").get<int> ();
    m_info.block_size   = node.child ("block_size").get<int> ();
    m_info.num_channels = node.child ("num_channels").get<int> ();
    node.child ("output").get (out);

    m_world->set_info (m_info);

    stop_output ();
    start_output ();
}
    virtual graph::audio_async_output_ptr
    build_output (base::conf_node& conf)
    {
        auto server = conf.child ("server").get<std::string> ();
	m_output = io::new_jack_output<graph::audio_const_range>(server, 44100);
	return m_output;
    }
    virtual graph::audio_async_output_ptr
    do_start (base::conf_node& conf)
    {
     	m_on_server_change_slot =
	    conf.child ("server").on_change.connect
	    (boost::bind (&output_director_jack::on_server_change, this, _1));

        return build_output (conf);
    };
    void on_server_change (base::conf_node& conf)
    {
#if PSYNTH_ON_DEVICE_CHANGE_LISTENER 
        auto old_state = m_output->state ();
        build_output (*conf.parent ());
        if (old_state == io::async_state::running)
            m_output->start ();
#endif
    }
Beispiel #5
0
void director::start (base::conf_node& conf, const boost::filesystem::path& home_path)
{
    m_config = &conf;

    m_filemgr.start (conf.child ("file_manager"), home_path);

    for (auto i = m_outdir.begin(); i != m_outdir.end(); ++i)
    {
        std::unique_ptr<output_director> od (i->second->create_output_director());
	od->defaults(m_config->child (i->first));
    }

    register_config();

    m_info.sample_rate = conf.child ("sample_rate").get<int> ();
    m_info.num_channels = conf.child ("num_channels").get<int> ();
    m_info.block_size = conf.child ("block_size").get<int> ();

    m_world = new world (m_info);
    m_world->set_patcher (base::manage (new patcher_dynamic));

    start_output ();
}
    void defaults (base::conf_node& conf)
    {
	conf.child ("server").def (
	    std::string (PSYNTH_DEFAULT_JACK_SERVER));
    }