-Add: Get client name from jack and show in title. Reuse the name when reconnecting to jack.
git-svn-id: http://svn.fuzzle.org/mloop/trunk@30 ba049829-c6ef-42ef-81ac-908dd8d2e907master
parent
c271123265
commit
604ae996d6
|
@ -13,6 +13,7 @@ Jack::Jack()
|
||||||
m_recording = false;
|
m_recording = false;
|
||||||
m_loop_buffer = new RingBuffer(2048);
|
m_loop_buffer = new RingBuffer(2048);
|
||||||
m_notecache.Reset();
|
m_notecache.Reset();
|
||||||
|
m_client_name = "mloop";
|
||||||
}
|
}
|
||||||
|
|
||||||
Jack::~Jack()
|
Jack::~Jack()
|
||||||
|
@ -26,7 +27,7 @@ bool Jack::Connect()
|
||||||
if (m_connected) return true;
|
if (m_connected) return true;
|
||||||
|
|
||||||
jack_status_t status;
|
jack_status_t status;
|
||||||
m_client = jack_client_open("mloop", JackNoStartServer, &status);
|
m_client = jack_client_open(m_client_name, JackNoStartServer, &status);
|
||||||
if (m_client == NULL) {
|
if (m_client == NULL) {
|
||||||
if (status & JackServerFailed) {
|
if (status & JackServerFailed) {
|
||||||
fprintf(stderr, "JACK server not running\n");
|
fprintf(stderr, "JACK server not running\n");
|
||||||
|
@ -38,6 +39,7 @@ bool Jack::Connect()
|
||||||
|
|
||||||
m_connected = true;
|
m_connected = true;
|
||||||
|
|
||||||
|
m_client_name = jack_get_client_name(m_client);
|
||||||
m_sample_rate = jack_get_sample_rate(m_client);
|
m_sample_rate = jack_get_sample_rate(m_client);
|
||||||
|
|
||||||
jack_on_shutdown(m_client, &ShutdownCallbackHandler, this);
|
jack_on_shutdown(m_client, &ShutdownCallbackHandler, this);
|
||||||
|
|
|
@ -46,6 +46,8 @@ public:
|
||||||
Jack();
|
Jack();
|
||||||
~Jack();
|
~Jack();
|
||||||
|
|
||||||
|
const char *m_client_name;
|
||||||
|
|
||||||
bool Connect();
|
bool Connect();
|
||||||
void Disconnect();
|
void Disconnect();
|
||||||
bool Run();
|
bool Run();
|
||||||
|
|
|
@ -60,7 +60,7 @@ bool UI::Run(Jack &j)
|
||||||
|
|
||||||
bkgdset(color_map[1]);
|
bkgdset(color_map[1]);
|
||||||
attrset(color_map[1]);
|
attrset(color_map[1]);
|
||||||
mvaddstr(y_offs, 0, " mloop ");
|
mvprintw(y_offs, 0, " mloop - %s", j.m_client_name);
|
||||||
clrtoeol();
|
clrtoeol();
|
||||||
y_offs++;
|
y_offs++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue