You are here

class video_preset in Video 6.5

Same name and namespace in other branches
  1. 6.4 includes/preset.inc \video_preset
  2. 7 includes/preset.inc \video_preset

Hierarchy

Expanded class hierarchy of video_preset

3 string references to 'video_preset'
video_admin_preset_submit in ./video.admin.inc
video_install in ./video.install
Implementation of hook_install().
video_update_6500 in ./video.install
Implementation of hook_update_N().

File

./video.lib.inc, line 108
File containing Video module interfaces and classes

View source
class video_preset {
  public $id = 0;
  public $name = '';
  public $help = '';
  public $extension = '';
  public $filenamesuffix = '';

  /**
   * Settings for the current transcoder
   *
   * @var array
   */
  private $settings = NULL;
  public function __construct(stdClass $dbdata) {
    $this->id = $dbdata->id;
    $this->name = $dbdata->name;
    $this->help = $dbdata->help;
    $this->extension = $dbdata->extension;
    $this->filenamesuffix = $dbdata->filenamesuffix;
  }
  public function getSettings() {
    if ($this->settings == NULL) {
      $transcoder = variable_get('vid_convertor', 'video_localcommand');
      $settings = db_result(db_query('SELECT data FROM {video_preset_settings} WHERE presetid = %d AND transcoder = "%s"', $this->id, $transcoder));
      if ($settings) {
        $this->settings = unserialize($settings);
      }
      else {
        $this->settings = array();
      }
    }
    return $this->settings;
  }
  public function setSettings(array $settings) {
    $transcoder = variable_get('vid_convertor', 'video_localcommand');
    $this->settings = $settings;
    db_query('REPLACE INTO {video_preset_settings} SET data = "%s", presetid = %d, transcoder = "%s"', serialize($settings), $this->id, $transcoder);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
video_preset::$extension public property
video_preset::$filenamesuffix public property
video_preset::$help public property
video_preset::$id public property
video_preset::$name public property
video_preset::$settings private property Settings for the current transcoder
video_preset::getSettings public function
video_preset::setSettings public function
video_preset::__construct public function