Skip to content

Commit

Permalink
Fix build errors, update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nhielost committed Sep 7, 2022
1 parent 93b2b20 commit 6689384
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ set(MACOS_BUNDLEID "com.nhielost.obs-midi-mg")
set(LINUX_MAINTAINER_EMAIL "nhielost@gmail.com")

# Include libremidi library
set(LIBREMIDI_HEADER_ONLY
ON
CACHE BOOL "Header-only mode")
add_subdirectory(libremidi EXCLUDE_FROM_ALL)
include_directories(libremidi/include)
target_link_libraries(obs-midi-mg PRIVATE libremidi)
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ Connect MIDI devices and seamlessly integrate with OBS Studio! This plugin offer

Go to the [Releases page](https://github.com/nhielost/obs-midi-mg/releases) and download and install the latest release for the proper operating system. That's it!

### macOS Users

It has been pointed out that the macOS installer will not always install correctly just by going through the installer normally. If this is the case, rerun the installer, and at the install page click the *Choose Install Location* button, then select the *Install for this user only* option. This will install the plugin in the proper location.

## Usage

To set up bindings, open OBS Studio and open the setup window under *Tools > obs-midi-mg Setup*. The setup window should appear.

If any MIDI devices are connected, they should appear in the ***Devices*** display on the left.

***NEW:*** *A device must be chosen as an active device in order to receive messages. To do this, select the **Set As Active Device** option in the device's status tab. Only one device can be active at a time.*

To access the bindings display, select the device to use for interacting with OBS Studio, and click *View Bindings* in the bottom right.

### Bindings
Expand All @@ -46,6 +45,8 @@ To edit the message, select the message in the ***Messages*** display, and the e

Adjust the values as necessary for the message. By default, the value/velocity option is OFF for the use of its value in executing actions. If you wish to make the value required for executing an action, click the OFF in the middle of the value field, and it will switch to a number. Clicking the number again will revert it to the OFF state.

There is a new feature where a message can be used by sending it to the plugin by the device. This can be done by selecting the *Listen to Message* button and sending the message to the plugin. It will automatically fill in the message values for you.

*Note: You can use multiple messages in a binding by adding more messages. If this is desired, the behavior of the binding may not be appropriate. See [Binding Modes](#binding-modes) for more details*.

### Actions
Expand Down
8 changes: 4 additions & 4 deletions src/mmg-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ void MMGDevice::output_send(const libremidi::message &message)

const QString MMGDevice::input_device_status() const
{
if (get_input_port_number(name) != -1) {
if (get_input_port_number(name) != (uint)-1) {
return "Ready";
} else if (get_output_port_number(name) != -1) {
} else if (get_output_port_number(name) != (uint)-1) {
return "Unavailable";
} else {
return "Not Connected";
Expand All @@ -203,9 +203,9 @@ const QString MMGDevice::input_device_status() const

const QString MMGDevice::output_device_status() const
{
if (get_output_port_number(name) != -1) {
if (get_output_port_number(name) != (uint)-1) {
return "Ready";
} else if (get_input_port_number(name) != -1) {
} else if (get_input_port_number(name) != (uint)-1) {
return "Unavailable";
} else {
return "Not Connected";
Expand Down
5 changes: 2 additions & 3 deletions src/mmg-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ with this program. If not, see <https://www.gnu.org/licenses/>

#include <obs-frontend-api.h>

void global_blog(int log_status, QString &message)
void global_blog(int log_status, const QString &message)
{
message.prepend("[obs-midi-mg] ");
blog(log_status, qPrintable(message));
blog(log_status, "[obs-midi-mg] %s", qPrintable(message));
}

size_t get_name_count(char **names)
Expand Down
2 changes: 1 addition & 1 deletion src/mmg-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <QLCDNumber>
#include <QDateTime>

void global_blog(int log_status, QString &message);
void global_blog(int log_status, const QString &message);

namespace MMGUtils {

Expand Down
2 changes: 0 additions & 2 deletions src/obs-midi-mg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "forms/midimg-window.h"
#include "mmg-config.h"

#include <winrt/windows.devices.midi.h>

#include <QAction>
#include <QMainWindow>
#include <QDir>
Expand Down

0 comments on commit 6689384

Please sign in to comment.