diff --git a/src_main/io_devices/piiodevice.cpp b/src_main/io_devices/piiodevice.cpp index 646f40e4..307cae2f 100755 --- a/src_main/io_devices/piiodevice.cpp +++ b/src_main/io_devices/piiodevice.cpp @@ -379,6 +379,16 @@ void PIIODevice::splitFullPath(PIString fpwm, PIString * full_path, DeviceMode * } +PIStringList PIIODevice::availablePrefixes() { + PIStringList ret; + PIVector rd(PICollection::groupElements("__PIIODevices__")); + piForeachC (PIObject * d, rd) { + ret << ((const PIIODevice * )d)->fullPathPrefix(); + } + return ret; +} + + PIString PIIODevice::fullPathOptions() const { if (mode_ == ReadWrite && options_ == 0) return PIString(); PIString ret(" ("); diff --git a/src_main/io_devices/piiodevice.h b/src_main/io_devices/piiodevice.h index b152feb5..45129ee1 100755 --- a/src_main/io_devices/piiodevice.h +++ b/src_main/io_devices/piiodevice.h @@ -256,6 +256,9 @@ public: static void splitFullPath(PIString fpwm, PIString * full_path, DeviceMode * mode = 0, DeviceOptions * opts = 0); + //! Returns fullPath prefixes of all registered devices + static PIStringList availablePrefixes(); + EVENT_HANDLER(bool, open) {if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} EVENT_HANDLER1(bool, open, const PIString &, _path) {setPath(_path); if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;}