pix_record.h 3.68 KB
Newer Older
1
2
/*
  -----------------------------------------------------------------
3

4
  GEM - Graphics Environment for Multimedia
5

6
7
  write a pix block into a digital video (like AVI, Mpeg, Quicktime) 
  (OS independant parent-class)
8

9
10
11
12
  Copyright (c) 2005-2010 Chris Clepper
  Copyright (c) 2009-2011 IOhannes m zmoelnig. forum::fr::umlute. IEM. zmoelnig@iem.kug.ac.at
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
13

14
15
  ----------------------------------------------------------------
*/
16
17

#if 1
18
//this will record movies
19
20
#ifndef INCLUDE_PIX_RECORD_H_
#define INCLUDE_PIX_RECORD_H_
21

cclepper's avatar
cclepper committed
22
23
24
#include "Base/GemBase.h"
#include "Base/GemPixUtil.h"

25
#include "plugins/record.h"
26

cclepper's avatar
cclepper committed
27
/*-----------------------------------------------------------------
28
29
30
  -------------------------------------------------------------------
  CLASS
  pix_record
cclepper's avatar
cclepper committed
31
    
32
  Writes a pix to disk
cclepper's avatar
cclepper committed
33
    
34
35
  KEYWORDS
  pix
cclepper's avatar
cclepper committed
36
    
37
  DESCRIPTION
cclepper's avatar
cclepper committed
38

39
40
41
  "file" - filename to write to
  "bang" - do write now
  "auto 0/1" - stop/start writing automatically
cclepper's avatar
cclepper committed
42
    
43
  -----------------------------------------------------------------*/
cclepper's avatar
cclepper committed
44
45
class GEM_EXTERN pix_record : public GemBase
{
46
  CPPEXTERN_HEADER(pix_record, GemBase)
cclepper's avatar
cclepper committed
47
48
49

    public:

50
51
52
  //////////
  // Constructor
  pix_record(int argc, t_atom *argv);
cclepper's avatar
cclepper committed
53
    	
54
 protected:
cclepper's avatar
cclepper committed
55
    	
56
57
58
59
60
61
  //////////
  // Destructor
  virtual ~pix_record();
	
  virtual void	stopRecording();
  virtual void	startRecording();
cclepper's avatar
cclepper committed
62
    	
63
64
65
66
67
68
69
70
71
72
73
74
  //////////
  // Do the rendering
  virtual void 	render(GemState *state);

  //////////
  // Clear the dirty flag on the pixBlock
  virtual void 	postrender(GemState *state) {};

  //////////
  // Set the filename and filetype
  std::string m_filename;
  virtual void	fileMess(int argc, t_atom *argv);
cclepper's avatar
cclepper committed
75
 
76
77
78
  //////////
  // turn recording on/off
  virtual void	recordMess(bool on);
79

80
81
82
  ////////
  // call up compression dialog
  virtual void	dialogMess();
83
		
84
85
86
  virtual void	getCodecList();
  std::string m_codec;
  virtual void	codecMess(t_atom *argv);
87

88
89
90
  //////////
  // Manual writing
  bool            m_banged;
cclepper's avatar
cclepper committed
91
    	
92
93
94
  //////////
  // Automatic writing
  bool            m_automatic;
95
	
96
97
98
  //////////
  // a outlet for information like #frames
  t_outlet     *m_outNumFrames;
99
  // another outlet for extra information (like list of codecs...)
100
101
102
103
104
105
  t_outlet     *m_outInfo;
  
  int m_currentFrame; //keep track of the number of frames
  
  //////////
  //
zmoelnig's avatar
zmoelnig committed
106
  int m_maxFrames;
107
108
109
110
111
112
113
114
115
116
117
  
  gem::Properties m_props;
  virtual void	enumPropertiesMess(void);
  virtual void	setPropertiesMess(int argc, t_atom*argv);
  virtual void	clearPropertiesMess(void);	
  
 private:
  bool m_recording;
  gem::record *m_handle;
  std::vector<std::string>m_ids;
  std::vector<gem::record*>m_handles;
zmoelnig's avatar
zmoelnig committed
118
  std::vector<gem::record*>m_allhandles;
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
  virtual bool addHandle(std::vector<std::string>available_ids, std::string id=std::string(""));
  //////////
  // static member functions
  static void 	fileMessCallback(void *data, t_symbol *s, int argc, t_atom *argv);
  static void 	autoMessCallback(void *data, t_floatarg on);
  static void 	bangMessCallback(void *data);
  
  static void 	recordMessCallback(void *data, t_floatarg on);
  static void 	dialogMessCallback(void *data);
  static void 	codeclistMessCallback(void *data);
  static void 	codecMessCallback(void *data, t_symbol *s, int argc, t_atom *argv);

  static void 	minMessCallback(void *data, t_floatarg min);
  static void 	maxMessCallback(void *data, t_floatarg max);



  static void enumPropertiesMessCallback(void *data);
  static void setPropertiesMessCallback(void *data, t_symbol*,int, t_atom*);
  static void clearPropertiesMessCallback(void *data);

  class PIMPL;
  PIMPL*m_pimpl;
cclepper's avatar
cclepper committed
142
143
};
#endif	// for header file
144
#endif //removes pix_record