MediaConnection: Add connection name handling
This commit is contained in:
@@ -67,7 +67,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
BMediaConnection(
|
BMediaConnection(
|
||||||
media_connection_kinds kinds);
|
media_connection_kinds kinds,
|
||||||
|
const char* name = NULL);
|
||||||
virtual ~BMediaConnection();
|
virtual ~BMediaConnection();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -115,7 +116,7 @@ private:
|
|||||||
|
|
||||||
class BMediaInput : public virtual BMediaConnection {
|
class BMediaInput : public virtual BMediaConnection {
|
||||||
protected:
|
protected:
|
||||||
BMediaInput();
|
BMediaInput(const char* name = NULL);
|
||||||
virtual ~BMediaInput();
|
virtual ~BMediaInput();
|
||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
@@ -147,7 +148,7 @@ private:
|
|||||||
|
|
||||||
class BMediaOutput : public virtual BMediaConnection {
|
class BMediaOutput : public virtual BMediaConnection {
|
||||||
protected:
|
protected:
|
||||||
BMediaOutput();
|
BMediaOutput(const char* name = NULL);
|
||||||
virtual ~BMediaOutput();
|
virtual ~BMediaOutput();
|
||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ media_connection::_BuildMediaInput() const
|
|||||||
input.source = source;
|
input.source = source;
|
||||||
input.destination = destination;
|
input.destination = destination;
|
||||||
input.format = format;
|
input.format = format;
|
||||||
|
strcpy(input.name, name);
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +79,7 @@ media_connection::_BuildMediaOutput() const
|
|||||||
output.source = source;
|
output.source = source;
|
||||||
output.destination = destination;
|
output.destination = destination;
|
||||||
output.format = format;
|
output.format = format;
|
||||||
|
strcpy(output.name, name);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ BMediaClientNode::PrepareToConnect(const media_source& source,
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
*out_source = conn->_Source();
|
*out_source = conn->_Source();
|
||||||
strcpy(name, Name());
|
strcpy(name, conn->Name());
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
BMediaConnection::BMediaConnection(media_connection_kinds kinds)
|
BMediaConnection::BMediaConnection(media_connection_kinds kinds,
|
||||||
|
const char* name)
|
||||||
:
|
:
|
||||||
fOwner(NULL),
|
fOwner(NULL),
|
||||||
fBind(NULL)
|
fBind(NULL)
|
||||||
@@ -20,6 +21,8 @@ BMediaConnection::BMediaConnection(media_connection_kinds kinds)
|
|||||||
fConnection.kinds = kinds;
|
fConnection.kinds = kinds;
|
||||||
fConnection.id = -1;
|
fConnection.id = -1;
|
||||||
//fConnection.client = media_client::null;
|
//fConnection.client = media_client::null;
|
||||||
|
if (name != NULL)
|
||||||
|
strcpy(fConnection.name, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,6 +47,13 @@ BMediaConnection::Client() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char*
|
||||||
|
BMediaConnection::Name() const
|
||||||
|
{
|
||||||
|
return fConnection.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BMediaConnection::HasBinding() const
|
BMediaConnection::HasBinding() const
|
||||||
{
|
{
|
||||||
@@ -160,9 +170,9 @@ void BMediaConnection::_ReservedMediaConnection9() {}
|
|||||||
void BMediaConnection::_ReservedMediaConnection10() {}
|
void BMediaConnection::_ReservedMediaConnection10() {}
|
||||||
|
|
||||||
|
|
||||||
BMediaInput::BMediaInput()
|
BMediaInput::BMediaInput(const char* name)
|
||||||
:
|
:
|
||||||
BMediaConnection(B_MEDIA_INPUT)
|
BMediaConnection(B_MEDIA_INPUT, name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +217,9 @@ void BMediaInput::_ReservedMediaInput9() {}
|
|||||||
void BMediaInput::_ReservedMediaInput10() {}
|
void BMediaInput::_ReservedMediaInput10() {}
|
||||||
|
|
||||||
|
|
||||||
BMediaOutput::BMediaOutput()
|
BMediaOutput::BMediaOutput(const char* name)
|
||||||
:
|
:
|
||||||
BMediaConnection(B_MEDIA_OUTPUT),
|
BMediaConnection(B_MEDIA_OUTPUT, name),
|
||||||
fBufferGroup(NULL)
|
fBufferGroup(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user