Skip to content

Commit

Permalink
run clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
lorado committed Mar 16, 2021
1 parent bd5f632 commit e25b51b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/Midi_hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class MidiHook : public QObject {
void setAction();
void initHotkey();
void setHotkey(obs_hotkey_t *hotkey);
obs_hotkey_t *getHotkey() const;
obs_hotkey_t *getHotkey() const;

private:
QString hotkey;
obs_hotkey_t *hotkeyInstance;
QString hotkey;
obs_hotkey_t *hotkeyInstance;
};
8 changes: 4 additions & 4 deletions src/events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ void Events::OnSceneChange()
}
void Events::FinishedLoading()
{
hookTransitionPlaybackEvents();
startup();
started=true;
initialiseHotkeysHooks();
hookTransitionPlaybackEvents();
startup();
started = true;
initialiseHotkeysHooks();
broadcastUpdate("LoadingFinished");
}
/**
Expand Down
8 changes: 4 additions & 4 deletions src/forms/settings-dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ void PluginWindow::add_new_mapping()
const auto int_override = new QTableWidgetItem(QString::number(ui->sb_int_override->value()));
const auto min = new QTableWidgetItem(QString::number(ui->sb_min->value()));
const auto max = new QTableWidgetItem(QString::number(ui->sb_max->value()));
obs_hotkey_t *hotkey = ((HotkeyModel *)ui->cb_obs_output_hotkey->model())->getHotkeyAtIndex(ui->cb_obs_output_hotkey->currentIndex());
obs_hotkey_t *hotkey = ((HotkeyModel *)ui->cb_obs_output_hotkey->model())->getHotkeyAtIndex(ui->cb_obs_output_hotkey->currentIndex());
const auto hotkey_item = new QTableWidgetItem(obs_hotkey_get_description(hotkey));
ui->table_mapping->setItem(row, 0, channel_item);
ui->table_mapping->setItem(row, 1, message_type_item);
Expand Down Expand Up @@ -755,7 +755,7 @@ void PluginWindow::add_new_mapping()
}
if (ui->cb_obs_output_hotkey->isVisible()) {
ui->table_mapping->setItem(row, 14, hotkey_item);
new_midi_hook->setHotkey(hotkey);
new_midi_hook->setHotkey(hotkey);
}

new_midi_hook->setAction();
Expand Down Expand Up @@ -809,7 +809,7 @@ void PluginWindow::add_row_from_hook(const MidiHook *hook) const
auto *item_item = new QTableWidgetItem(hook->item);
auto *audio_item = new QTableWidgetItem(hook->audio_source);
auto *media_item = new QTableWidgetItem(hook->media_source);
obs_hotkey_t *hotkey = hook->getHotkey();
obs_hotkey_t *hotkey = hook->getHotkey();
auto *hotkey_item = hotkey ? new QTableWidgetItem(obs_hotkey_get_description(hotkey)) : new QTableWidgetItem();
QTableWidgetItem *ioveritem = (hook->int_override) ? new QTableWidgetItem(QString::number(*hook->int_override)) : new QTableWidgetItem();
QTableWidgetItem *min = (hook->range_min) ? new QTableWidgetItem(QString::number(*hook->range_min)) : new QTableWidgetItem();
Expand Down Expand Up @@ -859,7 +859,7 @@ void PluginWindow::tab_changed(const int tab) const
ui->cb_obs_output_action->setCurrentIndex(1);
ui->cb_obs_output_action->setCurrentIndex(0);
ui->mapping_lbl_device_name->setText(ui->list_midi_dev->currentItem()->text());
((HotkeyModel *)ui->cb_obs_output_hotkey->model())->fetchHotkeys();
((HotkeyModel *)ui->cb_obs_output_hotkey->model())->fetchHotkeys();
}
clear_table();
load_table();
Expand Down
2 changes: 1 addition & 1 deletion src/obs-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ void ToggleSourceFilter(MidiHook *hook)
}
void TriggerHotkey(MidiHook *hook)
{
obs_hotkey_t *hotkeyInstance = hook->getHotkey();
obs_hotkey_t *hotkeyInstance = hook->getHotkey();
if (!hotkeyInstance) {
throw("Hotkey not found");
}
Expand Down
5 changes: 3 additions & 2 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ QVariant HotkeyModel::data(const QModelIndex &index, int role) const
return QVariant();

if (role == Qt::DisplayRole) {
return QVariant(obs_hotkey_get_description(hotkeysList[index.row()]));
return QVariant(obs_hotkey_get_description(hotkeysList[index.row()]));
}
return QVariant();
}
Expand Down Expand Up @@ -1070,7 +1070,8 @@ obs_hotkey_t *HotkeyModel::getHotkeyAtIndex(int index)
}
int HotkeyModel::getIndexOfHotkeyDescription(QString hotkeyDescription)
{
auto it = std::find_if(hotkeysList.begin(), hotkeysList.end(), [&hotkeyDescription](obs_hotkey_t *hotkey) { return QString(obs_hotkey_get_description(hotkey)) == hotkeyDescription; });
auto it = std::find_if(hotkeysList.begin(), hotkeysList.end(),
[&hotkeyDescription](obs_hotkey_t *hotkey) { return QString(obs_hotkey_get_description(hotkey)) == hotkeyDescription; });

if (it != hotkeysList.end()) {
return std::distance(hotkeysList.begin(), it);
Expand Down
4 changes: 2 additions & 2 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ActionsClass : public QObject {
Toggle_Start_Stop_Recording,
Toggle_Start_Stop_Replay_Buffer,
Toggle_Start_Stop_Streaming,
Trigger_Hotkey_By_Name,
Trigger_Hotkey_By_Name,
Unpause_Recording
};
Q_ENUM(Actions)
Expand Down Expand Up @@ -248,7 +248,7 @@ class HotkeyModel : public QAbstractListModel {
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
void fetchHotkeys();
obs_hotkey_t *getHotkeyAtIndex(int index);
obs_hotkey_t *getHotkeyAtIndex(int index);
int getIndexOfHotkeyDescription(QString hotkeyDescription);

private:
Expand Down

0 comments on commit e25b51b

Please sign in to comment.