function video_get_presets in Video 6.5
Get (active) presets
Parameters
$all: Whether to return all presets or just the active ones
Return value
array Requested video_preset instances
4 calls to video_get_presets()
- video_admin_preset_delete_validate in ./
video.admin.inc - video_preset_admin_settings in ./
video.admin.inc - Video transcoder admin settings
- video_process_video in ./
video.module - video_run_queue in ./
video.module
File
- ./
video.module, line 593 - Main file of the Video module.
Code
function video_get_presets($all = FALSE) {
module_load_include('lib.inc', 'video');
$presets = array();
if ($all) {
$result = db_query('SELECT * FROM {video_preset}');
}
else {
$current = variable_get('vid_preset', NULL);
if (!empty($current)) {
$result = db_query('SELECT * FROM {video_preset} WHERE id IN (' . db_placeholders($current) . ')', $current);
}
else {
$result = db_query_range('SELECT * FROM {video_preset} ORDER BY id ASC', 0, 2);
}
}
while ($row = db_fetch_object($result)) {
$presets[$row->id] = new video_preset($row);
}
return $presets;
}