mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
SG: add calls to update inventory from core, and use lan interface list in GUI
git-svn-id: svn://localhost/ardour2/branches/3.0-SG@12620 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e392b271d5
commit
2b1fdfe815
2 changed files with 61 additions and 28 deletions
|
|
@ -52,15 +52,18 @@ class SoundGrid : public boost::noncopyable
|
||||||
uint32_t assign;
|
uint32_t assign;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string mac;
|
std::string mac;
|
||||||
|
std::string hostname;
|
||||||
uint32_t channels;
|
uint32_t channels;
|
||||||
|
std::string device;
|
||||||
|
std::string status;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SGSInventoryItem : public InventoryItem {
|
struct SGSInventoryItem : public InventoryItem {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IOInventoryItem : public InventoryItem {
|
struct IOInventoryItem : public InventoryItem {
|
||||||
std::string device;
|
int32_t sample_rate;
|
||||||
std::string status;
|
int32_t output_channels;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<InventoryItem*> Inventory;
|
typedef std::vector<InventoryItem*> Inventory;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@
|
||||||
#include "ardour/debug.h"
|
#include "ardour/debug.h"
|
||||||
#include "ardour/soundgrid.h"
|
#include "ardour/soundgrid.h"
|
||||||
|
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
||||||
#include <Foundation/Foundation.h>
|
#include <Foundation/Foundation.h>
|
||||||
|
|
@ -177,10 +179,9 @@ SoundGrid::lan_port_names ()
|
||||||
eRetVal = instance().get (&audioDevices.m_controlInfo.m_controlID, (WSControlInfo*)&audioDevices);
|
eRetVal = instance().get (&audioDevices.m_controlInfo.m_controlID, (WSControlInfo*)&audioDevices);
|
||||||
|
|
||||||
for (uint32_t n = 0; n < audioDevices.m_audioDevices.numberOfDevices; ++n) {
|
for (uint32_t n = 0; n < audioDevices.m_audioDevices.numberOfDevices; ++n) {
|
||||||
cerr << "Discovered audio device [" << audioDevices.m_audioDevices.deviceNames[n] << "]\n";
|
names.push_back (audioDevices.m_audioDevices.deviceNames[n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
names.push_back ("00:00:00:1e:af - builtin ethernet controller");
|
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,37 +194,66 @@ SoundGrid::coreaudio_device_name ()
|
||||||
void
|
void
|
||||||
SoundGrid::update_inventory (Inventory& inventory)
|
SoundGrid::update_inventory (Inventory& inventory)
|
||||||
{
|
{
|
||||||
clear_inventory (inventory);
|
clear_inventory (inventory);
|
||||||
|
|
||||||
|
WSSGDevices currentSGDevices;
|
||||||
|
Init_WSSGDevices(¤tSGDevices);
|
||||||
|
WTErr eRetVal;
|
||||||
|
|
||||||
IOInventoryItem* ii = new (IOInventoryItem);
|
eRetVal = instance().get (¤tSGDevices.m_controlInfo.m_controlID, (WSControlInfo*)¤tSGDevices);
|
||||||
|
|
||||||
ii->assign = 1;
|
if (eRetVal != eNoErr) {
|
||||||
ii->device = "IO: Waves Virtual IO";
|
error << string_compose (_("SoundGrid: could not retrieve inventory (%1)"), eRetVal) << endmsg;
|
||||||
ii->channels = 8;
|
return;
|
||||||
ii->name = "Waves Virtual IO-1";
|
}
|
||||||
ii->mac = "00:16:cb:8a:e8:3e";
|
|
||||||
ii->status = "N/A";
|
|
||||||
|
|
||||||
inventory.push_back (ii);
|
DEBUG_TRACE (PBD::DEBUG::SoundGrid, string_compose ("inventory contains %1 IO boxes and %2 servers\n",
|
||||||
|
currentSGDevices.m_IOBoxs.m_numberOfDevices,
|
||||||
|
currentSGDevices.m_SGServers.m_numberOfDevices));
|
||||||
|
|
||||||
ii = new IOInventoryItem;
|
for (uint32_t n = 0; n < currentSGDevices.m_IOBoxs.m_numberOfDevices; ++n) {
|
||||||
ii->assign = 1;
|
IOInventoryItem* ii = new (IOInventoryItem);
|
||||||
ii->device = "IO: Yamaha Y16";
|
WSIOBoxDevice* dev = ¤tSGDevices.m_IOBoxs.m_ioBoxDevices[n];
|
||||||
ii->channels = 32;
|
|
||||||
ii->name = "Yamaha/Waves Y16";
|
|
||||||
ii->mac = "00:16:cb:8a:e8:3e";
|
|
||||||
ii->status = "OK";
|
|
||||||
|
|
||||||
inventory.push_back (ii);
|
ii->assign = dev->assignIndex;
|
||||||
|
ii->device = dev->type;
|
||||||
|
ii->channels = dev->channelCount;
|
||||||
|
ii->channels = dev->outputChannelCount;
|
||||||
|
ii->sample_rate = dev->sampleRate;
|
||||||
|
ii->name = dev->name;
|
||||||
|
ii->hostname = dev->hostname;
|
||||||
|
ii->mac = dev->mac;
|
||||||
|
if (dev->isIncompatible) {
|
||||||
|
ii->status = _("Incompatible");
|
||||||
|
} else if (dev->isActive) {
|
||||||
|
ii->status = _("Active");
|
||||||
|
} else {
|
||||||
|
ii->status = _("Inactive");
|
||||||
|
}
|
||||||
|
|
||||||
|
inventory.push_back (ii);
|
||||||
|
}
|
||||||
|
|
||||||
SGSInventoryItem* is = new (SGSInventoryItem);
|
for (uint32_t n = 0; n < currentSGDevices.m_SGServers.m_numberOfDevices; ++n) {
|
||||||
|
SGSInventoryItem* is = new (SGSInventoryItem);
|
||||||
is->assign = 1;
|
WSSGSDevice* dev = ¤tSGDevices.m_SGServers.m_sgsDevices[n];
|
||||||
is->name = "Waves Impact Server";
|
|
||||||
is->mac = "00:00:fe:ed:fa:ce";
|
|
||||||
is->channels = 16;
|
|
||||||
|
|
||||||
inventory.push_back (is);
|
is->assign = dev->assignIndex;
|
||||||
|
is->device = dev->type;
|
||||||
|
is->channels = dev->channelCount;
|
||||||
|
is->name = dev->name;
|
||||||
|
is->hostname = dev->hostname;
|
||||||
|
is->mac = dev->mac;
|
||||||
|
if (dev->isIncompatible) {
|
||||||
|
is->status = _("Incompatible");
|
||||||
|
} else if (dev->isActive) {
|
||||||
|
is->status = _("Active");
|
||||||
|
} else {
|
||||||
|
is->status = _("Inactive");
|
||||||
|
}
|
||||||
|
|
||||||
|
inventory.push_back (is);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue