Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Format obs-vst with clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jp9000 committed Jun 24, 2019
1 parent fde438f commit e7d21c3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 44 deletions.
47 changes: 23 additions & 24 deletions VSTPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ VSTPlugin::VSTPlugin(obs_source_t *sourceContext) : sourceContext{sourceContext}

VSTPlugin::~VSTPlugin()
{
int numChannels = VST_MAX_CHANNELS;

for (int channel = 0; channel < numChannels; channel++) {
if (inputs[channel]) {
free(inputs[channel]);
inputs[channel] = NULL;
}
if (outputs[channel]) {
free(outputs[channel]);
outputs[channel] = NULL;
}
}
if (inputs) {
free(inputs);
inputs = NULL;
}
if (outputs) {
free(outputs);
outputs = NULL;
}
int numChannels = VST_MAX_CHANNELS;

for (int channel = 0; channel < numChannels; channel++) {
if (inputs[channel]) {
free(inputs[channel]);
inputs[channel] = NULL;
}
if (outputs[channel]) {
free(outputs[channel]);
outputs[channel] = NULL;
}
}
if (inputs) {
free(inputs);
inputs = NULL;
}
if (outputs) {
free(outputs);
outputs = NULL;
}
}

void VSTPlugin::loadEffectFromPath(std::string path)
Expand Down Expand Up @@ -167,11 +167,10 @@ void VSTPlugin::openEditor()
}

if (filterName.empty()) {
editorWidget->setWindowTitle(QString("%1 - %2").arg(sourceName.c_str(),
effectName));
editorWidget->setWindowTitle(QString("%1 - %2").arg(sourceName.c_str(), effectName));
} else {
editorWidget->setWindowTitle(QString("%1:%2 - %3").arg(sourceName.c_str(),
filterName.c_str(), effectName));
editorWidget->setWindowTitle(
QString("%1:%2 - %3").arg(sourceName.c_str(), filterName.c_str(), effectName));
}
editorWidget->show();
}
Expand Down
27 changes: 13 additions & 14 deletions headers/VSTPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ class VSTPlugin {

bool effectReady = false;

std::string sourceName;
std::string filterName;
char effectName[64];
std::string sourceName;
std::string filterName;
char effectName[64];
// Remove below... or comment out
char vendorString[64];


#ifdef __APPLE__
CFBundleRef bundle = NULL;
#elif WIN32
Expand Down Expand Up @@ -88,17 +87,17 @@ class VSTPlugin {
public:
VSTPlugin(obs_source_t *sourceContext);
~VSTPlugin();
void loadEffectFromPath(std::string path);
void unloadEffect();
void openEditor();
void closeEditor();
std::string getChunk();
void setChunk(std::string data);
void setProgram(const int programNumber);
int getProgram();
void getSourceNames();
void loadEffectFromPath(std::string path);
void unloadEffect();
void openEditor();
void closeEditor();
std::string getChunk();
void setChunk(std::string data);
void setProgram(const int programNumber);
int getProgram();
void getSourceNames();
obs_audio_data *process(struct obs_audio_data *audio);
bool openInterfaceWhenActive = false;
bool openInterfaceWhenActive = false;
};

#endif // OBS_STUDIO_VSTPLUGIN_H
2 changes: 1 addition & 1 deletion linux/EditorWidget-linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void EditorWidget::buildEffectContainer(AEffect *effect)
screen->root_visual, /* visual */
0,
NULL /* masks, not used yet */
);
);

/* Map the window on the screen */
xcb_map_window(connection, window);
Expand Down
2 changes: 1 addition & 1 deletion obs-vst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static obs_properties_t *vst_properties(void *data)
{
obs_properties_t *props = obs_properties_create();
obs_property_t * list = obs_properties_add_list(
props, "plugin_path", PLUG_IN_NAME, OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
props, "plugin_path", PLUG_IN_NAME, OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);

fill_out_plugins(list);

Expand Down
3 changes: 3 additions & 0 deletions vst_header/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Language: Cpp
SortIncludes: false
DisableFormat: true
5 changes: 1 addition & 4 deletions win/EditorWidget-win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ void EditorWidget::handleResizeRequest(int, int)
PluginRc.top = rec->top;

// set rect to our window
AdjustWindowRectEx(&PluginRc,
WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPEDWINDOW,
FALSE,
0);
AdjustWindowRectEx(&PluginRc, WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPEDWINDOW, FALSE, 0);

// move window to apply pos
MoveWindow(windowHandle,
Expand Down

0 comments on commit e7d21c3

Please sign in to comment.