summaryrefslogtreecommitdiff
path: root/bin/jsonapi.php
blob: 35ec623e9d9ea6aa8df0780852de14c0474a526c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php

function getGlobals()
{
	global $vdrstreamdev, $vdrrecpath, $mediasource;

	$ret = array();
	$ret['streamdev_server'] = $vdrstreamdev;
	$ret['rec_path'] = $vdrrecpath;
	$ret['video_path'] = "/mnt/media/Video/";
	$ret['audio_path'] = "/mnt/media/Music/";

	return json_encode($ret);
}

function getTvCat()
{
	$ret = array();
	$ret['categories'] = vdrgetcategories();
	
	return json_encode($ret);
}

function getFullChanList()
{
	$catlist = array();

	// Get all categories
	$categories = vdrgetcategories();

	// For all categories
	$count = count($categories);
	for ($i = 0; $i < $count; $i++)
	{
		$tmpcat = array();

		$tmpcat['name'] = $categories[$i]['name'];
		$tmpcat['channel'] = vdrgetchannels($tmpcat['name'], 0);

		$catlist[] = $tmpcat;
	}

	$ret = array();
	$ret['category'] = $catlist;

	return json_encode($ret);
}

function getTvChan($cat)
{
	$ret = array();
	$ret['channel'] = vdrgetchannels($cat, 1);

	return json_encode($ret);
}

function getChanInfo($channum)
{
	$ret = array();
	
	$info = array();
	$ret['program'] = vdrgetchaninfo($channum);

	return json_encode($ret);
}

function startBroadcast($type, $url, $mode)
{
	$ret = array();

	$ret['session'] = sessioncreate($type, $url, $mode);

	return json_encode($ret); 
}


?>