SegmentInfoCommon.h 2.49 KB
Newer Older
1 2 3 4 5 6 7
/*****************************************************************************
 * SegmentInfoCommon.h: Implement the common part for both SegmentInfoDefault
 *                      and SegmentInfo
 *****************************************************************************
 * Copyright (C) 1998-2007 VLC authors and VideoLAN
 * $Id$
 *
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
8
 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef SEGMENTINFOCOMMON_H
#define SEGMENTINFOCOMMON_H

#include <string>
#include <list>
30 31
#include "Inheritables.hpp"
#include "Templates.hpp"
32
#include "Segment.h"
33
#include "ICanonicalUrl.hpp"
34
#include "../tools/Properties.hpp"
35

36
namespace adaptive
37
{
38
    namespace playlist
39
    {
40
        class Segment;
41

42
        class SegmentInfoCommon : public ICanonicalUrl,
43 44
                                  public Initializable<Segment>,
                                  public Indexable<Segment>
45 46
        {
            public:
47
                SegmentInfoCommon( ICanonicalUrl *parent = NULL );
48
                virtual ~SegmentInfoCommon();
49 50 51
                int                     getStartIndex() const;
                void                    setStartIndex( int startIndex );
                void                    appendBaseURL( const std::string& url );
52
                virtual Url             getUrlSegment() const; /* impl */
53 54 55
                Property<stime_t>      duration;
                static bool             getSegmentNumberByScaledTime(const std::vector<ISegment *> &,
                                                                     stime_t, uint64_t *);
56 57 58 59 60 61 62 63 64

            private:
                int                     startIndex;
                std::list<std::string>  baseURLs;
        };
    }
}

#endif // SEGMENTINFOCOMMON_H