Bug 232 - Added new '.in' files.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1679 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-12-16 10:16:29 +00:00
parent a35a06dc1d
commit 01476d308b
4 changed files with 693 additions and 0 deletions

5
db/zmdrop.sql.in Normal file
View File

@ -0,0 +1,5 @@
--
-- Current Database: @ZM_DB_NAME@
--
DROP DATABASE /*!40000 IF EXISTS*/ @ZM_DB_NAME@;

398
db/zmschema.sql.in Normal file
View File

@ -0,0 +1,398 @@
--
-- Current Database: @ZM_DB_NAME@
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ @ZM_DB_NAME@;
USE @ZM_DB_NAME@;
--
-- Table structure for table `Config`
--
CREATE TABLE Config (
Id smallint(5) unsigned NOT NULL default '0',
Name varchar(32) NOT NULL default '',
Value text NOT NULL,
Type tinytext NOT NULL,
DefaultValue tinytext,
Hint tinytext,
Pattern tinytext,
Format tinytext,
Prompt tinytext,
Help text,
Category varchar(32) NOT NULL default '',
Readonly tinyint(3) unsigned NOT NULL default '0',
Requires text,
PRIMARY KEY (Name),
UNIQUE KEY UC_Name (Name)
) TYPE=MyISAM;
--
-- Table structure for table `Controls`
--
CREATE TABLE Controls (
Id int(10) unsigned NOT NULL auto_increment,
Name varchar(64) NOT NULL default '',
Type enum('Local','Remote') NOT NULL default 'Local',
Command varchar(255) default NULL,
CanWake tinyint(3) unsigned NOT NULL default '0',
CanSleep tinyint(3) unsigned NOT NULL default '0',
CanReset tinyint(3) unsigned NOT NULL default '0',
CanZoom tinyint(3) unsigned NOT NULL default '0',
CanAutoZoom tinyint(3) unsigned NOT NULL default '0',
CanZoomAbs tinyint(3) unsigned NOT NULL default '0',
CanZoomRel tinyint(3) unsigned NOT NULL default '0',
CanZoomCon tinyint(3) unsigned NOT NULL default '0',
MinZoomRange int(10) unsigned default NULL,
MaxZoomRange int(10) unsigned default NULL,
MinZoomStep int(10) unsigned default NULL,
MaxZoomStep int(10) unsigned default NULL,
HasZoomSpeed tinyint(3) unsigned NOT NULL default '0',
MinZoomSpeed int(10) unsigned default NULL,
MaxZoomSpeed int(10) unsigned default NULL,
CanFocus tinyint(3) unsigned NOT NULL default '0',
CanAutoFocus tinyint(3) unsigned NOT NULL default '0',
CanFocusAbs tinyint(3) unsigned NOT NULL default '0',
CanFocusRel tinyint(3) unsigned NOT NULL default '0',
CanFocusCon tinyint(3) unsigned NOT NULL default '0',
MinFocusRange int(10) unsigned default NULL,
MaxFocusRange int(10) unsigned default NULL,
MinFocusStep int(10) unsigned default NULL,
MaxFocusStep int(10) unsigned default NULL,
HasFocusSpeed tinyint(3) unsigned NOT NULL default '0',
MinFocusSpeed int(10) unsigned default NULL,
MaxFocusSpeed int(10) unsigned default NULL,
CanIris tinyint(3) unsigned NOT NULL default '0',
CanAutoIris tinyint(3) unsigned NOT NULL default '0',
CanIrisAbs tinyint(3) unsigned NOT NULL default '0',
CanIrisRel tinyint(3) unsigned NOT NULL default '0',
CanIrisCon tinyint(3) unsigned NOT NULL default '0',
MinIrisRange int(10) unsigned default NULL,
MaxIrisRange int(10) unsigned default NULL,
MinIrisStep int(10) unsigned default NULL,
MaxIrisStep int(10) unsigned default NULL,
HasIrisSpeed tinyint(3) unsigned NOT NULL default '0',
MinIrisSpeed int(10) unsigned default NULL,
MaxIrisSpeed int(10) unsigned default NULL,
CanGain tinyint(3) unsigned NOT NULL default '0',
CanAutoGain tinyint(3) unsigned NOT NULL default '0',
CanGainAbs tinyint(3) unsigned NOT NULL default '0',
CanGainRel tinyint(3) unsigned NOT NULL default '0',
CanGainCon tinyint(3) unsigned NOT NULL default '0',
MinGainRange int(10) unsigned default NULL,
MaxGainRange int(10) unsigned default NULL,
MinGainStep int(10) unsigned default NULL,
MaxGainStep int(10) unsigned default NULL,
HasGainSpeed tinyint(3) unsigned NOT NULL default '0',
MinGainSpeed int(10) unsigned default NULL,
MaxGainSpeed int(10) unsigned default NULL,
CanWhite tinyint(3) unsigned NOT NULL default '0',
CanAutoWhite tinyint(3) unsigned NOT NULL default '0',
CanWhiteAbs tinyint(3) unsigned NOT NULL default '0',
CanWhiteRel tinyint(3) unsigned NOT NULL default '0',
CanWhiteCon tinyint(3) unsigned NOT NULL default '0',
MinWhiteRange int(10) unsigned default NULL,
MaxWhiteRange int(10) unsigned default NULL,
MinWhiteStep int(10) unsigned default NULL,
MaxWhiteStep int(10) unsigned default NULL,
HasWhiteSpeed tinyint(3) unsigned NOT NULL default '0',
MinWhiteSpeed int(10) unsigned default NULL,
MaxWhiteSpeed int(10) unsigned default NULL,
HasPresets tinyint(3) unsigned NOT NULL default '0',
NumPresets tinyint(3) unsigned NOT NULL default '0',
HasHomePreset tinyint(3) unsigned NOT NULL default '0',
CanSetPresets tinyint(3) unsigned NOT NULL default '0',
CanMove tinyint(3) unsigned NOT NULL default '0',
CanMoveDiag tinyint(3) unsigned NOT NULL default '0',
CanMoveMap tinyint(3) unsigned NOT NULL default '0',
CanMoveAbs tinyint(3) unsigned NOT NULL default '0',
CanMoveRel tinyint(3) unsigned NOT NULL default '0',
CanMoveCon tinyint(3) unsigned NOT NULL default '0',
CanPan tinyint(3) unsigned NOT NULL default '0',
MinPanRange int(10) default NULL,
MaxPanRange int(10) default NULL,
MinPanStep int(10) default NULL,
MaxPanStep int(10) default NULL,
HasPanSpeed tinyint(3) unsigned NOT NULL default '0',
MinPanSpeed int(10) default NULL,
MaxPanSpeed int(10) default NULL,
HasTurboPan tinyint(3) unsigned NOT NULL default '0',
TurboPanSpeed int(10) default NULL,
CanTilt tinyint(3) unsigned NOT NULL default '0',
MinTiltRange int(10) default NULL,
MaxTiltRange int(10) default NULL,
MinTiltStep int(10) default NULL,
MaxTiltStep int(10) default NULL,
HasTiltSpeed tinyint(3) unsigned NOT NULL default '0',
MinTiltSpeed int(10) default NULL,
MaxTiltSpeed int(10) default NULL,
HasTurboTilt tinyint(3) unsigned NOT NULL default '0',
TurboTiltSpeed int(10) default NULL,
CanAutoScan tinyint(3) unsigned NOT NULL default '0',
NumScanPaths tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (Id),
UNIQUE KEY UC_Id (Id)
) TYPE=MyISAM;
--
-- Table structure for table `Events`
--
CREATE TABLE Events (
Id int(10) unsigned NOT NULL auto_increment,
MonitorId int(10) unsigned NOT NULL default '0',
Name varchar(64) NOT NULL default '',
Cause varchar(32) NOT NULL default '',
StartTime datetime default NULL,
EndTime datetime default NULL,
Width smallint(5) unsigned NOT NULL default '0',
Height smallint(5) unsigned NOT NULL default '0',
Length decimal(10,2) NOT NULL default '0.00',
Frames int(10) unsigned default NULL,
AlarmFrames int(10) unsigned default NULL,
TotScore int(10) unsigned NOT NULL default '0',
AvgScore smallint(5) unsigned default '0',
MaxScore smallint(5) unsigned default '0',
Archived tinyint(3) unsigned NOT NULL default '0',
Videoed tinyint(3) unsigned NOT NULL default '0',
Uploaded tinyint(3) unsigned NOT NULL default '0',
Emailed tinyint(3) unsigned NOT NULL default '0',
Messaged tinyint(3) unsigned NOT NULL default '0',
Executed tinyint(3) unsigned NOT NULL default '0',
LearnState char(1) default '',
Notes tinytext,
PRIMARY KEY (Id),
UNIQUE KEY UC_Id (Id),
KEY Id (Id,MonitorId),
KEY MonitorId (MonitorId),
KEY StartTime (StartTime),
KEY Frames (Frames),
KEY Archived (Archived)
) TYPE=MyISAM;
--
-- Table structure for table `Filters`
--
CREATE TABLE Filters (
Name varchar(64) NOT NULL default '',
Query text NOT NULL,
AutoArchive tinyint(3) unsigned NOT NULL default '0',
AutoVideo tinyint(3) unsigned NOT NULL default '0',
AutoUpload tinyint(3) unsigned NOT NULL default '0',
AutoEmail tinyint(3) unsigned NOT NULL default '0',
AutoMessage tinyint(3) unsigned NOT NULL default '0',
AutoExecute tinyint(3) unsigned NOT NULL default '0',
AutoExecuteCmd tinytext,
AutoDelete tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (Name)
) TYPE=MyISAM;
--
-- Table structure for table `Frames`
--
CREATE TABLE Frames (
Id int(10) unsigned NOT NULL auto_increment,
EventId int(10) unsigned NOT NULL default '0',
FrameId int(10) unsigned NOT NULL default '0',
Type enum('Normal','Bulk','Alarm') NOT NULL default 'Normal',
TimeStamp timestamp(14) NOT NULL,
Delta decimal(8,2) NOT NULL default '0.00',
Score smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (Id),
UNIQUE KEY UC_Id (Id),
KEY EventId (EventId),
KEY Type (Type),
KEY TimeStamp (TimeStamp)
) TYPE=MyISAM;
--
-- Table structure for table `Groups`
--
CREATE TABLE Groups (
Id int(10) unsigned NOT NULL auto_increment,
Name varchar(64) NOT NULL default '',
MonitorIds tinytext NOT NULL,
PRIMARY KEY (Id)
) TYPE=MyISAM;
--
-- Table structure for table `Monitors`
--
CREATE TABLE Monitors (
Id int(10) unsigned NOT NULL auto_increment,
Name varchar(64) NOT NULL default '',
Type enum('Local','Remote','File') NOT NULL default 'Local',
Function enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor',
RunMode enum('Continuous','Triggered') NOT NULL default 'Continuous',
Triggers set('X10') NOT NULL default '',
Device tinytext,
Channel tinyint(3) unsigned NOT NULL default '0',
Format tinyint(3) unsigned NOT NULL default '0',
Host varchar(64) default NULL,
Port varchar(8) default '80',
Path varchar(255) default NULL,
Width smallint(5) unsigned NOT NULL default '0',
Height smallint(5) unsigned NOT NULL default '0',
Palette tinyint(3) unsigned NOT NULL default '1',
Orientation enum('0','90','180','270','hori','vert') NOT NULL default '0',
Brightness mediumint(7) NOT NULL default '-1',
Contrast mediumint(7) NOT NULL default '-1',
Hue mediumint(7) NOT NULL default '-1',
Colour mediumint(7) NOT NULL default '-1',
EventPrefix varchar(32) NOT NULL default 'Event-',
LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S',
LabelX smallint(5) unsigned default NULL,
LabelY smallint(5) unsigned default NULL,
ImageBufferCount smallint(5) unsigned NOT NULL default '100',
WarmupCount smallint(5) unsigned NOT NULL default '25',
PreEventCount smallint(5) unsigned NOT NULL default '10',
PostEventCount smallint(5) unsigned NOT NULL default '10',
AlarmFrameCount smallint(5) unsigned NOT NULL default '1',
SectionLength int(10) unsigned NOT NULL default '600',
FrameSkip smallint(5) unsigned NOT NULL default '0',
MaxFPS decimal(5,2) NOT NULL default '0.00',
FPSReportInterval smallint(5) unsigned NOT NULL default '250',
RefBlendPerc tinyint(3) unsigned NOT NULL default '10',
Controllable tinyint(3) unsigned NOT NULL default '0',
ControlId int(10) unsigned NOT NULL default '0',
ControlDevice varchar(255) default NULL,
ControlAddress varchar(255) default NULL,
AutoStopTimeout decimal(5,2) default NULL,
TrackMotion tinyint(3) unsigned NOT NULL default '0',
TrackDelay smallint(5) unsigned NOT NULL default '0',
ReturnLocation tinyint(3) NOT NULL default '-1',
ReturnDelay smallint(5) unsigned NOT NULL default '0',
DefaultRate smallint(5) unsigned NOT NULL default '100',
DefaultScale smallint(5) unsigned NOT NULL default '100',
WebColour varchar(32) NOT NULL default 'red',
Sequence smallint(5) unsigned default NULL,
PRIMARY KEY (Id)
) TYPE=MyISAM;
--
-- Table structure for table `States`
--
CREATE TABLE States (
Name varchar(64) NOT NULL default '',
Definition tinytext NOT NULL,
PRIMARY KEY (Name)
) TYPE=MyISAM;
--
-- Table structure for table `Stats`
--
CREATE TABLE Stats (
MonitorId int(10) unsigned NOT NULL default '0',
ZoneId int(10) unsigned NOT NULL default '0',
EventId int(10) unsigned NOT NULL default '0',
FrameId int(10) unsigned NOT NULL default '0',
AlarmPixels int(10) unsigned NOT NULL default '0',
FilterPixels int(10) unsigned NOT NULL default '0',
BlobPixels int(10) unsigned NOT NULL default '0',
Blobs smallint(5) unsigned NOT NULL default '0',
MinBlobSize int(10) unsigned NOT NULL default '0',
MaxBlobSize int(10) unsigned NOT NULL default '0',
MinX smallint(5) unsigned NOT NULL default '0',
MaxX smallint(5) unsigned NOT NULL default '0',
MinY smallint(5) unsigned NOT NULL default '0',
MaxY smallint(5) unsigned NOT NULL default '0',
Score smallint(5) unsigned NOT NULL default '0',
KEY EventId (EventId),
KEY MonitorId (MonitorId),
KEY ZoneId (ZoneId)
) TYPE=MyISAM;
--
-- Table structure for table `TriggersX10`
--
CREATE TABLE TriggersX10 (
MonitorId int(10) unsigned NOT NULL default '0',
Activation varchar(32) default NULL,
AlarmInput varchar(32) default NULL,
AlarmOutput varchar(32) default NULL,
PRIMARY KEY (MonitorId)
) TYPE=MyISAM;
--
-- Table structure for table `Users`
--
CREATE TABLE Users (
Id int(10) unsigned NOT NULL auto_increment,
Username varchar(32) binary NOT NULL default '',
Password varchar(64) NOT NULL default '',
Language varchar(8) NOT NULL default '',
Enabled tinyint(3) unsigned NOT NULL default '1',
Stream enum('None','View') NOT NULL default 'None',
Events enum('None','View','Edit') NOT NULL default 'None',
Control enum('None','View','Edit') NOT NULL default 'None',
Monitors enum('None','View','Edit') NOT NULL default 'None',
System enum('None','View','Edit') NOT NULL default 'None',
MaxBandwidth varchar(16) NOT NULL default '',
MonitorIds tinytext NOT NULL,
PRIMARY KEY (Id),
UNIQUE KEY UC_Id (Id),
UNIQUE KEY UC_Username (Username)
) TYPE=MyISAM;
--
-- Table structure for table `Zones`
--
CREATE TABLE Zones (
Id int(10) unsigned NOT NULL auto_increment,
MonitorId int(10) unsigned NOT NULL default '0',
Name varchar(64) NOT NULL default '',
Type enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active',
Units enum('Pixels','Percent') NOT NULL default 'Pixels',
NumCoords tinyint(3) unsigned NOT NULL default '0',
Coordinates tinytext NOT NULL,
Area int(10) NOT NULL unsigned default '0',
LoX smallint(5) unsigned NOT NULL default '0',
LoY smallint(5) unsigned NOT NULL default '0',
HiX smallint(5) unsigned NOT NULL default '0',
HiY smallint(5) unsigned NOT NULL default '0',
AlarmRGB int(10) unsigned default '0',
CheckMethod enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs',
MinPixelThreshold smallint(5) unsigned default NULL,
MaxPixelThreshold smallint(5) unsigned default NULL,
MinAlarmPixels int(10) unsigned default NULL,
MaxAlarmPixels int(10) unsigned default NULL,
FilterX tinyint(3) unsigned default NULL,
FilterY tinyint(3) unsigned default NULL,
MinFilterPixels int(10) unsigned default NULL,
MaxFilterPixels int(10) unsigned default NULL,
MinBlobPixels int(10) unsigned default NULL,
MaxBlobPixels int(10) unsigned default NULL,
MinBlobs smallint(5) unsigned default NULL,
MaxBlobs smallint(5) unsigned default NULL,
PRIMARY KEY (Id),
UNIQUE KEY UC_Id (Id)
) TYPE=MyISAM;
--
-- Create a default admin user.
--
insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','','');
--
-- Add in a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though
--
insert into Filters values ('PurgeWhenFull','trms=2&obr1=&cbr1=&attr1=Archived&op1==&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=95&sort_field=Id&sort_asc=1&limit=5',0,0,0,0,0,'');
--
-- Add in some sample control protocol definitions
--
insert into Controls values (1,'PELCO-D','Local','zmcontrol-pelco-d.pl',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0);
insert into Controls values (2,'PELCO-P','Local','zmcontrol-pelco-p.pl',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0);
insert into Controls values (3,'Sony VISCA','Local','zmcontrol-visca.pl',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0);
INSERT INTO Controls VALUES (4,'Axis API v2','Remote','zmcontrol-axis-v2.pl',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0);
insert into Controls values (5,'KX-HCM10','Remote','zmcontrol-kx-hcm10.pl',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0);

103
src/zm_config.h.in Normal file
View File

@ -0,0 +1,103 @@
//
// ZoneMinder Configuration, $Date$, $Revision$
// Copyright (C) 2003, 2004, 2005 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
#include "config.h"
#include "zm_config_defines.h"
#define ZM_CONFIG "@ZM_CONFIG@" // Path to config file
#define ZM_VERSION "@VERSION@" // ZoneMinder Version
#define ZM_MAX_IMAGE_WIDTH 2048 // The largest image we imagine ever handling
#define ZM_MAX_IMAGE_HEIGHT 1536 // The largest image we imagine ever handling
#define ZM_MAX_IMAGE_COLOURS 3 // The largest image we imagine ever handling
#define ZM_MAX_IMAGE_DIM (ZM_MAX_IMAGE_WIDTH*ZM_MAX_IMAGE_HEIGHT)
#define ZM_MAX_IMAGE_SIZE (ZM_MAX_IMAGE_DIM*ZM_MAX_IMAGE_COLOURS)
#define ZM_SCALE_SCALE 100 // The factor by which we bump up 'scale' to simulate FP
#define ZM_RATE_SCALE 100 // The factor by which we bump up 'rate' to simulate FP
#define ZM_MAX_FPS 30 // The maximum frame rate we expect to handle
#define ZM_SAMPLE_RATE int(1000000/ZM_MAX_FPS) // A general nyquist sample frequency for delays etc
extern char *ZM_DB_HOST, *ZM_DB_NAME, *ZM_DB_USER, *ZM_DB_PASS, *ZM_PATH_WEB;
extern void zmLoadConfig();
class ConfigItem
{
private:
char *name;
char *value;
char *type;
mutable enum { CFG_BOOLEAN, CFG_INTEGER, CFG_DECIMAL, CFG_STRING } cfg_type;
mutable union
{
bool boolean_value;
int integer_value;
double decimal_value;
char *string_value;
} cfg_value;
mutable bool accessed;
public:
ConfigItem( const char *p_name, const char *p_value, const char *const p_type );
~ConfigItem();
void ConvertValue() const;
bool BooleanValue() const;
int IntegerValue() const;
double DecimalValue() const;
const char *StringValue() const;
inline operator bool() const
{
return( BooleanValue() );
}
inline operator int() const
{
return( IntegerValue() );
}
inline operator double() const
{
return( DecimalValue() );
}
inline operator const char *() const
{
return( StringValue() );
}
};
class Config
{
public:
ZM_CFG_DECLARE_LIST
private:
int n_items;
ConfigItem **items;
public:
Config();
~Config();
void Load();
void Assign();
const ConfigItem &Item( int id );
};
extern Config config;

187
web/zm_config.php.in Normal file
View File

@ -0,0 +1,187 @@
<?php
//
// ZoneMinder web configuration file, $Date$, $Revision$
// Copyright (C) 2003, 2004, 2005 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// This section contains options substituted by the zmconfig.pl utility, do not edit these directly
//
define( "ZM_CONFIG", "@ZM_CONFIG@" ); // Path to config file
$cfg = fopen( ZM_CONFIG, "r") or die("Could not open config file.");
while ( !feof($cfg) )
{
$str = fgets( $cfg, 256 );
if ( preg_match( '/^\s*$/', $str )) { continue; }
elseif ( preg_match( '/^\s*#/', $str )) { continue; }
elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/', $str, $matches ))
{
define( $matches[1], $matches[2] );
}
}
fclose( $cfg );
// This section is options normally derived from other options or configuration
//
define( "ZMU_PATH", ZM_PATH_BIN."/zmu" ); // Local path to the ZoneMinder Utility
// Alarm states
//
define( "STATE_IDLE", 0 );
define( "STATE_PREALARM", 1 );
define( "STATE_ALARM", 2 );
define( "STATE_ALERT", 3 );
define( "STATE_TAPE", 4 );
// These are miscellaneous options you won't normally need to change
//
define( "MAX_EVENTS", 10 ); // The maximum number of events to show in the monitor event listing
define( "RATE_SCALE", 100 ); // The additional scaling factor used to help get fractional rates in integer format
define( "SCALE_SCALE", 100 ); // The additional scaling factor used to help get fractional scales in integer format
define( "LEARN_MODE", false ); // Currently unimplemented, do not change
define( 'DEVICE_WIDTH', 150 ); // Default device width for phones and handhelds
define( 'DEVICE_HEIGHT', 150 ); // Default device height for phones and handhelds
define( 'DEVICE_LINES', 10 ); // Default device lines for phones and handhelds
require_once( 'zm_db.php' );
loadConfig();
switch ( $bandwidth )
{
case "high" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_H_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_H_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_IMAGE_SCALING", ZM_WEB_H_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_USE_STREAMS", ZM_WEB_H_USE_STREAMS ); // Whether to use streaming or stills for live and events views
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_H_EVENTS_VIEW ); // What the default view of multiple events should be.
break;
}
case "medium" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_M_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_M_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_IMAGE_SCALING", ZM_WEB_M_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_USE_STREAMS", ZM_WEB_M_USE_STREAMS ); // Whether to use streaming or stills for live and events views
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_M_EVENTS_VIEW ); // What the default view of multiple events should be.
break;
}
case "low" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_L_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_L_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_IMAGE_SCALING", ZM_WEB_L_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_USE_STREAMS", ZM_WEB_L_USE_STREAMS ); // Whether to use streaming or stills for live and events views
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_L_EVENTS_VIEW ); // What the default view of multiple events should be.
break;
}
case "mobile" : // Very incomplete at present
{
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_P_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
break;
}
}
function loadConfig()
{
global $config;
global $config_cats;
$config = array();
$config_cat = array();
$sql = "select * from Config order by Id asc";
$result = mysql_query( $sql );
if ( !$result )
echo mysql_error();
$monitors = array();
while( $row = mysql_fetch_assoc( $result ) )
{
define( $row['Name'], $row['Value'] );
$config[$row['Name']] = $row;
if ( !($config_cat = &$config_cats[$row['Category']]) )
{
$config_cats[$row['Category']] = array();
$config_cat = &$config_cats[$row['Category']];
}
$config_cat[$row['Name']] = $row;
}
//print_r( $config );
//print_r( $config_cats );
}
// Javascript window sizes
$jws = array(
'bandwidth' => array( 'w'=>200, 'h'=>90 ),
'console' => array( 'w'=>750, 'h'=>312 ),
'control' => array( 'w'=>380, 'h'=>480 ),
'controlcaps' => array( 'w'=>700, 'h'=>320 ),
'controlcap' => array( 'w'=>360, 'h'=>440 ),
'cycle' => array( 'w'=>16, 'h'=>32 ),
'device' => array( 'w'=>196, 'h'=>164 ),
'donate' => array( 'w'=>500, 'h'=>280 ),
'event' => array( 'w'=>96, 'h'=>168 ),
'eventdetail' => array( 'w'=>400, 'h'=>220 ),
'events' => array( 'w'=>720, 'h'=>480 ),
'export' => array( 'w'=>400, 'h'=>340 ),
'filter' => array( 'w'=>620, 'h'=>250 ),
'filtersave' => array( 'w'=>560, 'h'=>220 ),
'frames' => array( 'w'=>500, 'h'=>300 ),
'function' => array( 'w'=>248, 'h'=>92 ),
'groups' => array( 'w'=>400, 'h'=>220 ),
'image' => array( 'w'=>48, 'h'=>80 ),
'login' => array( 'w'=>720, 'h'=>480 ),
'logout' => array( 'w'=>200, 'h'=>100 ),
'monitor' => array( 'w'=>360, 'h'=>324 ),
'montage' => array( 'w'=>10, 'h'=>20 ),
'optionhelp' => array( 'w'=>320, 'h'=>284 ),
'options' => array( 'w'=>780, 'h'=>540 ),
'preset' => array( 'w'=>240, 'h'=>90 ),
'restarting' => array( 'w'=>250, 'h'=>150 ),
'settings' => array( 'w'=>200, 'h'=>225 ),
'state' => array( 'w'=>300, 'h'=>120 ),
'stats' => array( 'w'=>680, 'h'=>200 ),
'timeline' => array( 'w'=>760, 'h'=>500 ),
'user' => array( 'w'=>280, 'h'=>372 ),
'version' => array( 'w'=>320, 'h'=>140 ),
'video' => array( 'w'=>100, 'h'=>80 ),
'watch' => array( 'w'=>96, 'h'=>384 ),
'zone' => array( 'w'=>400, 'h'=>450 ),
'zones' => array( 'w'=>72, 'h'=>232 ),
);
?>