|
From: <pst...@us...> - 2008-05-14 01:52:53
|
Revision: 521
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=521&view=rev
Author: pstieber
Date: 2008-05-13 18:52:51 -0700 (Tue, 13 May 2008)
Log Message:
-----------
1. Added some debug output.
2. Changed tAlsaDriverList::print to tAlsaDriverList::AsciiWrite and changed
the argument from const char* to sconst std::string&.
3. Cleaned up the tDeviceList code now that it is using an STL container.
Modified Paths:
--------------
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/AlsaPlayer.h
trunk/jazz/src/Player.cpp
trunk/jazz/src/Player.h
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2008-05-13 23:25:49 UTC (rev 520)
+++ trunk/jazz/src/AlsaPlayer.cpp 2008-05-14 01:52:51 UTC (rev 521)
@@ -99,6 +99,12 @@
// scan input addressess
scan_clients(iaddr, SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ);
+ cout << "Input device count: " << iaddr.GetCount() << endl;
+ if (iaddr.GetCount())
+ {
+ iaddr.AsciiWrite("Input Devices");
+ }
+
// scan output addresses
scan_clients(oaddr, SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE);
@@ -212,7 +218,7 @@
//-----------------------------------------------------------------------------
void tAlsaPlayer::subscribe_inp(int inp)
{
- snd_seq_port_subscribe_t *subs;
+ snd_seq_port_subscribe_t* subs;
snd_seq_port_subscribe_alloca(&subs);
snd_seq_port_subscribe_set_time_update(subs, 1);
snd_seq_port_subscribe_set_queue(subs, queue);
@@ -970,9 +976,9 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void tAlsaDeviceList::print(const char *msg)
+void tAlsaDeviceList::AsciiWrite(const string& Message)
{
- cout << msg << endl;
+ cout << Message << endl;
int i = 0;
for (
vector<snd_seq_addr_t>::const_iterator iSound = addr.begin();
Modified: trunk/jazz/src/AlsaPlayer.h
===================================================================
--- trunk/jazz/src/AlsaPlayer.h 2008-05-13 23:25:49 UTC (rev 520)
+++ trunk/jazz/src/AlsaPlayer.h 2008-05-14 01:52:51 UTC (rev 521)
@@ -28,12 +28,14 @@
#include <alsa/asoundlib.h>
+#include <string>
+
class tAlsaDeviceList : public tDeviceList
{
public:
unsigned add(const char* pName, const snd_seq_addr_t& a);
snd_seq_addr_t& operator[](unsigned i);
- void print(const char *msg);
+ void AsciiWrite(const std::string& Message);
private:
std::vector<snd_seq_addr_t> addr;
};
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2008-05-13 23:25:49 UTC (rev 520)
+++ trunk/jazz/src/Player.cpp 2008-05-14 01:52:51 UTC (rev 521)
@@ -77,40 +77,12 @@
tDeviceList::tDeviceList()
: mDeviceNames()
{
-// count = 0;
-// for (int i = 0; i < eMaximumDeviceCount; i++)
-// names[i] = 0;
}
-tDeviceList::tDeviceList(const char* pName)
-{
- mDeviceNames.push_back(pName);
-// count = 1;
-// for (int i = 0; i < eMaximumDeviceCount; i++)
-// names[i] = 0;
-// names[0] = copystring(name);
-}
-
tDeviceList::~tDeviceList()
{
-// for (int i = 0; i < count; i++)
-// delete [] names[i];
}
-//tNamedValue *tDeviceList::AsNamedValue()
-//{
-// tNamedValue *nv = new tNamedValue[count + 1];
-// for (int i = 0; i < count; i++)
-// {
-// nv[i].Name = copystring(names[i]);
-// nv[i].Value = i;
-// }
-// nv[count].Name = 0;
-// nv[count].Value = 0;
-// return nv;
-//}
-
-
// ------------------------- tPlayLoop --------------------------
tPlayLoop::tPlayLoop()
Modified: trunk/jazz/src/Player.h
===================================================================
--- trunk/jazz/src/Player.h 2008-05-13 23:25:49 UTC (rev 520)
+++ trunk/jazz/src/Player.h 2008-05-14 01:52:51 UTC (rev 521)
@@ -83,15 +83,8 @@
{
public:
- enum
- {
- eMaximumDeviceCount = 10
- };
-
tDeviceList();
- tDeviceList(const char* pName);
-
virtual ~tDeviceList();
unsigned GetCount() const
@@ -113,26 +106,15 @@
{
mDeviceNames.push_back(pName);
return mDeviceNames.size();
-// if (count < eMaximumDeviceCount)
-// {
-// names[count] = copystring(name);
-// return count++;
-// }
-// return eMaximumDeviceCount;
}
void Clear()
{
mDeviceNames.clear();
-// count = 0;
}
-// tNamedValue* AsNamedValue();
-
protected:
-// int count;
-// char *names[eMaximumDeviceCount];
std::vector<std::string> mDeviceNames;
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|