Skip to content

Commit

Permalink
Fixed sublayer for virtual devices
Browse files Browse the repository at this point in the history
  • Loading branch information
mauer committed Feb 10, 2024
1 parent 229431a commit a657492
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/plugin/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,20 @@ std::unique_ptr<device_settings> profile::create_device_settings(toml::value in_
}
}

// sl dataref
if (toml_utils::contains(*m_profile_log, in_params, CFG_KEY_SL_DATAREF))
settings->sl_dataref = toml_utils::read_string(*m_profile_log, in_params, CFG_KEY_SL_DATAREF);

if (!settings->sl_dataref.empty()) {
m_profile_log->info(get_log_prefix(in_is_virtual, in_dev_no) + " Sublayer mode activated");

if (!m_env.drf().check(settings->sl_dataref)) {
m_profile_log->error(get_log_prefix(in_is_virtual, in_dev_no) + "Dataref '" + settings->sl_dataref
+ "' not found");
return {};
}
}

// the following parameters are necessary for MIDI devices only
if (!in_is_virtual) {
// device number
Expand Down Expand Up @@ -496,20 +510,6 @@ std::unique_ptr<device_settings> profile::create_device_settings(toml::value in_
settings->send_mode = device_settings::send_mode_from_code(
toml_utils::read_string(*m_profile_log, in_params, CFG_KEY_MODE_OUT));

// load general settings for the profile
if (toml_utils::contains(*m_profile_log, in_params, CFG_KEY_SL_DATAREF))
settings->sl_dataref = toml_utils::read_string(*m_profile_log, in_params, CFG_KEY_SL_DATAREF);

if (!settings->sl_dataref.empty()) {
m_profile_log->info(get_log_prefix(in_is_virtual, in_dev_no) + " Sublayer mode activated");

if (!m_env.drf().check(settings->sl_dataref)) {
m_profile_log->error(get_log_prefix(in_is_virtual, in_dev_no) + "Dataref '" + settings->sl_dataref
+ "' not found");
return {};
}
}

// default encoder mode
settings->default_enc_mode = map_in_enc::encoder_mode_from_code(
toml_utils::read_string(*m_profile_log, in_params, CFG_KEY_ENCODER_MODE));
Expand Down

0 comments on commit a657492

Please sign in to comment.