#include <l1394_session.h>
Session constructor | |
These functions creates the Session objects. | |
Session () | |
Init a Session. | |
virtual | ~Session () |
static Session * | getSession () |
This method returns a pointer to the Session object. | |
Public Member Functions | |
Access the FireWire bus | |
These functions search and return the different nodes on the FireWire bus. All functions search on all installed FireWire cards. | |
int | getCardCount () const |
This method returns the number of cards in your computer. | |
const std::vector< std::string > & | getIsoDevices () const |
void | addEventHandle (EventHandle *) |
An EventHandle object added with this method reports about busresets on all cards. | |
void | removeEventHandle (EventHandle *) |
This method removes an EventHandle. | |
bool | nodeExist (u_int64_t guid) const |
This method tests, if a node with a specific guid exist. | |
const Card * | getCard (unsigned int card_id) const |
This method returns a pointer to the i'th card (beginning by 0). | |
list< const Card * > | getCardList () const |
This method returns the card_array. | |
Device * | findDevice (const string &name="Device") const |
This method finds the first Camera and returns it. | |
Device * | findDevice (u_int64_t guid) |
This method finds the Device with GUID guid. | |
Camera * | findCamera (u_int64_t guid) |
This method finds the Camera with GUID guid. | |
Vcr * | findVcr (u_int64_t guid) |
This method finds the Device with GUID guid. | |
Camera * | findCamera (const string &name="Camera") const |
This method finds the first Camera and returns it. | |
Vcr * | findVcr (const string &name="Vcr") const |
This method finds a Vcr and returns a pointer to it. | |
AvcVcr * | findAvcVcr (const string &name="AvcVcr") const |
This method finds an AvcVcr and returns a pointer to it. | |
DccCamera * | findDccCamera (const string &name="DccCamera") const |
This method finds the first DccCamera on FireWire bus and return it. | |
AvcCamera * | findAvcCamera (const string &name="AvcCamera") const |
This method find the first AvcCamera on the FireWire bus. | |
list< Device * > | getAllDevices () const |
This method returns a list of all Cameras on the FireWire bus. | |
list< Camera * > | getAllCameras () const |
This method returns a list of all Cameras on the FireWire bus. | |
list< Vcr * > | getAllVcrs () const |
This method returns a list with all Vcrs on the FireWire bus. | |
list< AvcVcr * > | getAllAvcVcrs () const |
This method returns a list with all AvcVcrs on the FireWire bus. | |
list< DccCamera * > | getAllDccCameras () const |
This method finds all DccCameras and return a list of them. | |
list< AvcCamera * > | getAllAvcCameras () const |
This method finds all AvcCameras and return a list of them. | |
Static Public Member Functions | |
Configure the library | |
These functions set some internal parameters. This library uses three ostreams to print messages. The debug_stream prints debug_messages, the message_stream prints some more or less informative messages and the error_stream prints error messages. By default all streams are set to cout. To disable the messages, set the stream to NULL. | |
static void | setDebugStream (std::ostream *o) |
This method sets the debug output. | |
static void | setMessageStream (std::ostream *o) |
This method sets the standard output. | |
static void | setErrorStream (std::ostream *o) |
This method sets the error output. | |
static void | setWarningStream (std::ostream *o) |
This method sets the error output. | |
static void | safeMode (bool mode=false, int delay=30) |
This method enables the safe-mode for the read and write functions. | |
Static Public Attributes | |
static bool | session_is_running = true |
static ThreadMutex | global_mutex |
Protected Member Functions | |
Node * | getNode (u_int64_t guid) const |
This method returns a pointer to a node specified by its guid return NULL, if node doesn't exist. | |
Node * | findNode (int node_type) const |
finds a node, specified by it's node_type. | |
list< Node * > | getAllNodes (int node_type) const |
returns a list with Nodes from type node_type | |
Friends | |
class | L1394::CreateUsingNew< Session > |
Every program using this library needs exactly one Session object. (There is further now way to create more than one object.)
The Session object has two major jobs. The first part is, to instantiate the Card objects and handle incoming events from the driver, like bus-resets. The Card object instantiate the L1394 Nodes for the connected nodes on FireWire bus.
The second one is, to represent a simple interface to find or get the L1394 Nodes for a FireWire node. These functions search on all FireWire cards.
There are also some static functions to set some internal parameters, like the output streams, or a so called 'safe-mode'. For more information about these mothods see the section 'Configure the Library'.
Normally your application needs to include the l1394_session.h file, for classes in namespace L1394.
To create a Session object you can call the static member function Session::getSession(), or the macro GetSession();
The session object is also responsible to delete all L1394 objects. You must not delete any object from this class, except the Session object itself!! If you delete some objects, no correct work is possible!!!!
If the getSession() function fails, the library quit the application with an error message. (The library quits an application only if the getSession() function fails)
A little example:
#include <l1394_session.h> using namespace L1394; int main(int argc, char* argv[]) { //Start a new Session. Session *session = GetSession(); for (int i = 0; i< session->getCardCount(); i++) session->getCard(i)->printNodeList(); //prints the device list to cout //Get all cameras list<Camera*> camera_list = session->getAllCameras(); list<Camera*>::iterator camera_iterator = camera_list.begin(); // Now you can work with the cameras. For example calibrate all cameras. for (int i = 0; i< camera_list.size(); i++) { if ((*camera_iterator)->whiteBalance()->hasFeature()) (*camera_iterator)->whiteBalance()->onePush(); if ((*camera_iterator)->zoom()->hasFeature()) (*camera_iterator)->zoom()->setValue((*camera_iterator)->zoom()->getMinValue)); //and so on .... } //Get all vcrs list<Vcr*> vcr_list = session->getAllVcrs(); list<Vcr*>::iterator vcr_iterator = vcr_iterator.begin(); //Now you can work with the devices. for (int i = 0; i< vcr_list.size(); i++) { //start all vcrs (*vcr_iterator)->play()->send(); vcr_iterator++; } }
For more information see the tutorial.
Definition at line 255 of file l1394_session.h.
|
Init a Session.
Definition at line 31 of file l1394_session.cpp. References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance(), global_mutex, and session_is_running. |
|
Definition at line 49 of file l1394_session.cpp. |
|
An EventHandle object added with this method reports about busresets on all cards.
Definition at line 336 of file l1394_session.cpp. References L1394::internal::Message::errorStream(). Referenced by SimpleEventHandle::SimpleEventHandle(). |
|
This method find the first AvcCamera on the FireWire bus.
|
|
This method finds an AvcVcr and returns a pointer to it.
|
|
This method finds the first Camera and returns it. This method searches on all Card objects. Definition at line 206 of file l1394_session.cpp. References getAllCameras(). |
|
This method finds the Camera with GUID guid. This method searches on all Card objects. Definition at line 425 of file l1394_session.cpp. References findDevice(). Referenced by main(). |
|
This method finds the first DccCamera on FireWire bus and return it.
Definition at line 295 of file l1394_session.cpp. References getAllDccCameras(). |
|
This method finds the Device with GUID guid. This method searches on all Card objects.
Definition at line 413 of file l1394_session.cpp. References getAllDevices(). |
|
This method finds the first Camera and returns it. This method searches on all Card objects. Definition at line 395 of file l1394_session.cpp. References getAllDevices(). Referenced by findCamera(), and findVcr(). |
|
finds a node, specified by it's node_type. A pointer to the first found node was returned, NULL if no node with this type was found.
Definition at line 137 of file l1394_session.cpp. References getCard(), and L1394::internal::Message::messageStream(). |
|
This method finds a Vcr and returns a pointer to it.
Definition at line 238 of file l1394_session.cpp. References getAllVcrs(). |
|
This method finds the Device with GUID guid. This method searches on all Card objects. Definition at line 429 of file l1394_session.cpp. References findDevice(). |
|
This method finds all AvcCameras and return a list of them.
Definition at line 308 of file l1394_session.cpp. References L1394::_Camera, L1394::_FcpNode, and getAllNodes(). Referenced by getAllCameras(). |
|
This method returns a list with all AvcVcrs on the FireWire bus.
Definition at line 272 of file l1394_session.cpp. References getAllVcrs(). |
|
This method returns a list of all Cameras on the FireWire bus. This method searches on all Cards
Definition at line 222 of file l1394_session.cpp. References getAllAvcCameras(), and getAllDccCameras(). Referenced by findCamera(), main(), SimpleEventHandle::SimpleEventHandle(), and SimpleEventHandle::~SimpleEventHandle(). |
|
This method finds all DccCameras and return a list of them.
Definition at line 283 of file l1394_session.cpp. References L1394::_DccNode, and getAllNodes(). Referenced by findDccCamera(), getAllCameras(), and main(). |
|
This method returns a list of all Cameras on the FireWire bus. This method searches on all Cards
Definition at line 495 of file l1394_session.cpp. References L1394::Card::getExplicitNode(). Referenced by findDevice(). |
|
returns a list with Nodes from type node_type
Definition at line 186 of file l1394_session.cpp. References getCard(). Referenced by getAllAvcCameras(), getAllDccCameras(), and getAllVcrs(). |
|
This method returns a list with all Vcrs on the FireWire bus.
Definition at line 256 of file l1394_session.cpp. References L1394::_FcpNode, L1394::_Vcr, and getAllNodes(). Referenced by findVcr(), and getAllAvcVcrs(). |
|
This method returns a pointer to the i'th card (beginning by 0).
Definition at line 170 of file l1394_session.cpp. Referenced by findNode(), getAllNodes(), main(), and nodeExist(). |
|
This method returns the number of cards in your computer.
Definition at line 269 of file l1394_session.h. |
|
This method returns the card_array. The card_array has size 16 and stores the pointer to all Card objects. If less than 16 cards the array is filled with NULL.
Definition at line 177 of file l1394_session.cpp. |
|
Definition at line 271 of file l1394_session.h. |
|
This method returns a pointer to a node specified by its guid return NULL, if node doesn't exist. This method searches on all cards.
Definition at line 166 of file l1394_session.cpp. References L1394::internal::NodeContainer::getNodeContainer(). |
|
This method returns a pointer to the Session object. If no session object exist, it is created.
|
|
This method tests, if a node with a specific guid exist. This method searches on all cards.
Definition at line 198 of file l1394_session.cpp. References getCard(). |
|
This method removes an EventHandle.
Definition at line 347 of file l1394_session.cpp. References L1394::internal::Message::errorStream(). Referenced by SimpleEventHandle::~SimpleEventHandle(). |
|
This method enables the safe-mode for the read and write functions. By enabling safe mode the read, write and lock functions are delayed for some msecs. If you send a lot of asynchrone commands, a bus rest can occur.
Definition at line 479 of file l1394_session.h. References L1394::internal::Transaction::setSafeMode(). |
|
This method sets the debug output.
Definition at line 446 of file l1394_session.h. References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance(). |
|
This method sets the error output.
Definition at line 461 of file l1394_session.h. References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance(). |
|
This method sets the standard output.
Definition at line 453 of file l1394_session.h. References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance(). |
|
This method sets the error output.
Definition at line 468 of file l1394_session.h. References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance(). |
|
Definition at line 257 of file l1394_session.h. |
|
Definition at line 508 of file l1394_session.cpp. Referenced by Session(). |
|
Definition at line 507 of file l1394_session.cpp. Referenced by Session(). |