1<?php 2/* vim:set softtabstop=4 shiftwidth=4 expandtab: */ 3 4/** 5 * 6 * LICENSE: GNU Affero General Public License, version 3 (AGPL-3.0-or-later) 7 * Copyright 2001 - 2020 Ampache.org 8 * 9 * This program is free software: you can redistribute it and/or modify 10 * it under the terms of the GNU Affero General Public License as published by 11 * the Free Software Foundation, either version 3 of the License, or 12 * (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU Affero General Public License for more details. 18 * 19 * You should have received a copy of the GNU Affero General Public License 20 * along with this program. If not, see <https://www.gnu.org/licenses/>. 21 * 22 */ 23 24namespace Ampache\Repository\Model; 25 26use PDOStatement; 27 28/** 29 * media Interface 30 * 31 * This defines how the media file classes should 32 * work, this lists all required functions and the expected 33 * input 34 */ 35interface Media 36{ 37 /** 38 * get_stream_types 39 * 40 * Returns an array of strings; current types are 'native' 41 * and 'transcode' 42 * @param array $player 43 */ 44 public function get_stream_types($player = array()); 45 46 /** 47 * play_url 48 * 49 * Returns the url to stream the specified object 50 * @param string $additional_params 51 * @param string $player 52 * @param boolean $local 53 */ 54 public function play_url($additional_params = '', $player = '', $local = false); 55 56 /** 57 * get_transcode_settings 58 * 59 * Should only be called if 'transcode' was returned by get_stream_types 60 * Returns a raw transcode command for this item; the optional target 61 * parameter can be used to request a specific format instead of the 62 * default from the configuration file. 63 * @param string $target 64 * @param string $player 65 * @param array $options 66 */ 67 public function get_transcode_settings($target = null, $player = null, $options = array()); 68 69 /** 70 * get_stream_name 71 * Get the complete name to display for the stream. 72 */ 73 public function get_stream_name(); 74 75 /** 76 * @param integer $user 77 * @param string $agent 78 * @param array $location 79 * @param integer $date 80 * @return boolean 81 */ 82 public function set_played($user, $agent, $location, $date = null); 83 84 /** 85 * @param integer $user 86 * @param string $agent 87 * @param integer $date 88 * @return boolean 89 */ 90 public function check_play_history($user, $agent, $date); 91 92 /** 93 * remove 94 * Remove the song from disk. 95 * @return PDOStatement|boolean 96 */ 97 public function remove(); 98} 99