Skip to content

Commit

Permalink
Log other stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
koteq committed Aug 25, 2024
1 parent c930b47 commit 2168124
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
27 changes: 11 additions & 16 deletions Source/IconMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ IconMenu::IconMenu() : INDEX_EDIT(1000000), INDEX_BYPASS(2000000), INDEX_DELETE(
formatManager.addDefaultFormats();
// Audio device
std::unique_ptr<XmlElement> savedAudioState (getAppProperties().getUserSettings()->getXmlValue("audioDeviceState"));
deviceManager.initialise(256, 256, savedAudioState.get(), true);
deviceManager.initialise(256, 256, savedAudioState.get(), false);
player.setProcessor(&graph);
deviceManager.addAudioCallback(&player);
deviceManager.addChangeListener(this);
Expand Down Expand Up @@ -221,6 +221,9 @@ void IconMenu::changeListenerCallback(ChangeBroadcaster* changed)
}
else if (changed == &deviceManager)
{
// deviceManager.removeAudioCallback(&player);
// deviceManager.addAudioCallback(&player);
// deviceManager.restartLastAudioDevice
dumpDeviceInfo();
}
}
Expand All @@ -232,21 +235,13 @@ void IconMenu::dumpDeviceInfo()
? deviceManager.getCurrentDeviceTypeObject()->getTypeName()
: "<none>"));

if (auto* device = deviceManager.getCurrentAudioDevice())
{
logger->logMessage("Current audio device: " + device->getName().quoted());
logger->logMessage("Sample rate: " + String (device->getCurrentSampleRate()) + " Hz");
logger->logMessage("Block size: " + String (device->getCurrentBufferSizeSamples()) + " samples");
logger->logMessage("Bit depth: " + String (device->getCurrentBitDepth()));
logger->logMessage("Input channel names: " + device->getInputChannelNames().joinIntoString (", "));
// logger->logMessage("Active input channels: " + getListOfActiveBits (device->getActiveInputChannels()));
logger->logMessage("Output channel names: " + device->getOutputChannelNames().joinIntoString (", "));
// logger->logMessage("Active output channels: " + getListOfActiveBits (device->getActiveOutputChannels()));
}
else
{
logger->logMessage("No audio device open");
}
auto setup = deviceManager.getAudioDeviceSetup();
logger->logMessage("inputDeviceName: " + setup.inputDeviceName.quoted());
logger->logMessage("outputDeviceName: " + setup.outputDeviceName.quoted());
logger->logMessage("useDefaultInputChannels: " + setup.useDefaultInputChannels);
logger->logMessage("useDefaultOutputChannels: " + setup.useDefaultOutputChannels);
logger->logMessage("bufferSize: " + setup.bufferSize);
logger->logMessage("sampleRate: " + String(setup.sampleRate));
}

#if JUCE_MAC
Expand Down
2 changes: 1 addition & 1 deletion Source/IconMenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IconMenu : public SystemTrayIconComponent, private Timer, public ChangeLis
void setIcon();
void dumpDeviceInfo();

FileLogger* logger = FileLogger::createDefaultAppLogger("", "app.log", "LightHost logfile");
FileLogger* logger = FileLogger::createDefaultAppLogger("Light Host", "app.log", "LightHost logfile");
AudioDeviceManager deviceManager;
AudioPluginFormatManager formatManager;
KnownPluginList knownPluginList;
Expand Down

0 comments on commit 2168124

Please sign in to comment.