This URL has Read-Only access.

Statistics
| Branch: | Tag: | Revision:

root / src / main.cpp @ 440227f8

History | View | Annotate | Download (1.8 kB)

1
/*
2
 * Copyright (C) 2012 Nicolas Bouillot (http://www.nicolasbouillot.net)
3
 *
4
 * This file is part of switcher.
5
 *
6
 * switcher is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * switcher is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with switcher.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19

    
20
#include "switcher/controller.h"
21
#include "switcher/runtime.h"
22
#include "switcher/base-entity.h"
23
#include "switcher/creator.h"
24
#include "switcher/video-test-source.h"
25
#include <iostream>
26

    
27

    
28
int
29
main (int argc,
30
      char *argv[])
31
{
32
  using namespace switcher;
33
  
34
  //Factory + registration of base entity
35
  Factory<BaseEntity, std::string> temp;
36
  temp.Register<Runtime> ("runtime");
37
  temp.Register<VideoTestSource> ("videotestsource");
38

    
39
  //Create and call
40
  BaseEntity::ptr runtime = temp.Create ("runtime");
41
  //printf("Runtime %u\n", runtime->Get());
42
  Runtime::ptr rt = std::tr1::dynamic_pointer_cast<Runtime> (runtime);
43
  
44
  BaseEntity::ptr videotest = temp.Create("videotestsource");
45
  VideoTestSource::ptr seg = std::tr1::dynamic_pointer_cast<VideoTestSource> (videotest); 
46
  seg->set_runtime (rt); //..and play
47
  
48
  // BaseEntity::ptr myvideotest = temp.Create("videotestsource");
49
  // VideoTestSource::ptr myseg = std::tr1::dynamic_pointer_cast<VideoTestSource> (myvideotest); 
50
  // rt->add_segment (myseg);
51

    
52

    
53
  rt->run();
54
  
55
  return 0;
56
}