Commit 2f332b0b authored by Damien Lucas's avatar Damien Lucas

. moved some old code from admin.cpp to manager_backwardcomp.cpp

parent aafd36f3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* admin.cpp: * admin.cpp:
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: admin.cpp,v 1.30 2003/08/14 11:12:54 nitrox Exp $ * $Id: admin.cpp,v 1.31 2003/08/20 15:05:40 nitrox Exp $
* *
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
...@@ -242,31 +242,12 @@ int C_Admin::Init() ...@@ -242,31 +242,12 @@ int C_Admin::Init()
pCmdDesc->m_vMandatoryArgs.Add(pStr); pCmdDesc->m_vMandatoryArgs.Add(pStr);
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- browse [input]
pCmdDesc = new C_CommandDesc("browse",
"gives the program list",
"Called with one argument, \"browse\" gives all programs of inputs."
" Called with one argument it only gives the programs of the"
" specified input. Each program is given with its status.");
pStr = new C_String("input");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- ls // -- ls
pCmdDesc = new C_CommandDesc("ls", pCmdDesc = new C_CommandDesc("ls",
"gives a global overview of the configuration state.", "gives a global overview of the configuration state.",
"gives a global overview of the configuration state."); "gives a global overview of the configuration state.");
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- show [broadcast|channel|program|input]
pCmdDesc = new C_CommandDesc("show",
"show running broadcasts, available channels, programs or inputs",
"Called with one argument, \"show\" gives information about "
" running broadcasts or available channels, programs or inputs.");
pStr = new C_String("command");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- config <filename> [--load] [--save] // -- config <filename> [--load] [--save]
pCmdDesc = new C_CommandDesc("config", pCmdDesc = new C_CommandDesc("config",
"load and save configuration file.", "load and save configuration file.",
...@@ -281,143 +262,6 @@ int C_Admin::Init() ...@@ -281,143 +262,6 @@ int C_Admin::Init()
pCmdDesc->m_vBooleans.Add(pStr); pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- program <name> <input> <filename> <type> [--add] [--delete]
pCmdDesc = new C_CommandDesc("program",
"configure an input with programs.",
"\"program\" adds a program definition to a specified input"
" it becomes available for broadcast.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("filename");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("type");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
// add or delete
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- input <name> <type=local> [dir] [--add] [--delete]
// -- input <name> <type=video> [device] [format] [--add] [--delete]
// -- input <name> <type=dvb> [device number] [device type=nova] [frequency] [polarization]
// [symbol rate] [diseqc] [lnb_lof1] [lnb_lof2] [lnb_slof] [--add] [--delete]
pCmdDesc = new C_CommandDesc("input",
"configure a new input.",
"\"input\" adds a input definition of type local, video or dvb."
" it becomes available for broadcast and program configuration.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("type");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
// for type=local
pStr = new C_String("dir");
pCmdDesc->m_vOptionalArgs.Add(pStr);
// for type=video
pStr = new C_String("device");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("format");
pCmdDesc->m_vOptionalArgs.Add(pStr);
// for type=dvb
pStr = new C_String("device_number");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("device_type");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("frequency");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("polarization");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("symbol_rate");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("use_disecq");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("lnb_lof1");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("lnb_lof2");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("lnb_slof");
pCmdDesc->m_vOptionalArgs.Add(pStr);
// add or delete
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- channel <name> <type> <dest_host> <dest_port> <streamtype> [domain] [ttl] [intf] [--add] [--delete]
pCmdDesc = new C_CommandDesc("channel",
"configure a new channel.",
"\"channel\" adds a channel definition."
" it becomes available for broadcast.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("type");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("dest_host");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("dest_port");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("streamtype");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("domain");
// Optional arguments
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("ttl");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("interface");
pCmdDesc->m_vOptionalArgs.Add(pStr);
// Boolean options
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- broadcast <name> <channel> <program> <input> [--add] [--delete] [--test]
pCmdDesc = new C_CommandDesc("broadcast",
"configure a new broadcast.",
"\"broadcast\" adds a broadcast definition."
" it becomes available for streaming.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("channel");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("program");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
// Boolean options
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("test");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- start <program> <channel> <input> [--loop] [--end] [--rtp]
pCmdDesc = new C_CommandDesc("start",
"launches a program.",
"\"start\" launches the specified program of the specified input"
" and broadcasts it through the specified channel.");
pStr = new C_String("program");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("channel");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("loop");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("end"); // jump to end of file
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("rtp");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->m_bExtendedOptions = true;
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- resume <channel> // -- resume <channel>
pCmdDesc = new C_CommandDesc("broadcast_resume", pCmdDesc = new C_CommandDesc("broadcast_resume",
"resumes streaming.", "resumes streaming.",
...@@ -499,6 +343,8 @@ int C_Admin::Init() ...@@ -499,6 +343,8 @@ int C_Admin::Init()
pCmdDesc->m_vMandatoryArgs.Add(pStr); pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input"); pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr); pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("loop");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- broadcast_del // -- broadcast_del
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* manager_backwardcomp.cpp: Vls manager backward compatibilty functions * manager_backwardcomp.cpp: Vls manager backward compatibilty functions
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2003 VideoLAN * (c)1999-2003 VideoLAN
* $Id: manager_backwardcomp.cpp,v 1.2 2003/08/14 11:12:54 nitrox Exp $ * $Id: manager_backwardcomp.cpp,v 1.3 2003/08/20 15:05:40 nitrox Exp $
* *
* Authors: Benoit Steiner <benny@via.ecp.fr> * Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
AddFunction("channel", &C_Manager::Channel); AddFunction("channel", &C_Manager::Channel);
AddFunction("start", &C_Manager::Start); AddFunction("start", &C_Manager::Start);
AddFunction("broadcast", &C_Manager::Broadcast); AddFunction("broadcast", &C_Manager::Broadcast);
#endif #endif /* EXTRA_INIT */
#ifdef EXTRA_DECL #ifdef EXTRA_DECL
C_Answer Browse(C_Request& cRequest); C_Answer Browse(C_Request& cRequest);
...@@ -48,6 +48,170 @@ ...@@ -48,6 +48,170 @@
#endif /* EXTRA_DECL*/ #endif /* EXTRA_DECL*/
#ifdef EXTRA_DEF
// browse
pCmdDesc = new C_CommandDesc(
"browse",
"gives the program list",
"Called with no argument, \"browse\" gives all programs of "
"inputs. Called with one argument it only gives the programs "
"of the specified input. Each program is given with its status.");
pStr = new C_String("input");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// show
pCmdDesc = new C_CommandDesc(
"show",
"show broadcasts, channels, programs or inputs",
"Called with one argument, \"show\" gives information about "
"broadcasts or available channels, programs or inputs.");
pStr = new C_String("command");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// program
pCmdDesc = new C_CommandDesc(
"program",
"configure an input with programs.",
"\"program\" adds a program definition to a specified input "
"it becomes available for broadcast.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("filename");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("type");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// input
pCmdDesc = new C_CommandDesc(
"input",
"configure a new input.",
"\"input\" adds a input definition of type local, video or dvb."
" it becomes available for broadcast and program configuration.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("type");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
// for type=local
pStr = new C_String("dir");
pCmdDesc->m_vOptionalArgs.Add(pStr);
// for type=video
pStr = new C_String("device");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("format");
pCmdDesc->m_vOptionalArgs.Add(pStr);
// for type=dvb
pStr = new C_String("device_number");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("device_type");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("frequency");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("polarization");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("symbol_rate");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("use_disecq");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("lnb_lof1");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("lnb_lof2");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("lnb_slof");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// channel
pCmdDesc = new C_CommandDesc(
"channel",
"configure a new channel.",
"\"channel\" adds a channel definition. "
"it becomes available for broadcast.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("type");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("dest_host");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("dest_port");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("streamtype");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("domain");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("ttl");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("interface");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- start <program> <channel> <input> [--loop] [--end] [--rtp]
pCmdDesc = new C_CommandDesc(
"start",
"launches a program.",
"\"start\" launches the specified program of the specified input "
"and broadcasts it through the specified channel.");
pStr = new C_String("program");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("channel");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("loop");
pCmdDesc->m_vOptionalArgs.Add(pStr);
pStr = new C_String("end"); // jump to end of file
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("rtp");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->m_bExtendedOptions = true;
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- broadcast <name> <channel> <program> <input> [--add] [--delete] [--test]
pCmdDesc = new C_CommandDesc(
"broadcast",
"configure a new broadcast.",
"\"broadcast\" adds a broadcast definition. "
"it becomes available for streaming.");
pStr = new C_String("name");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("channel");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("program");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("input");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("add");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("delete");
pCmdDesc->m_vBooleans.Add(pStr);
pStr = new C_String("test");
pCmdDesc->m_vBooleans.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
#endif
#ifdef EXTRA_CODE #ifdef EXTRA_CODE
C_Answer C_Manager::Browse(C_Request& cRequest) C_Answer C_Manager::Browse(C_Request& cRequest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment