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