Source: channelscannerregion.h


Annotated List
Files
Globals
Hierarchy
Index
// -*- c++ -*-

/*
 *
 * Copyright (C) 2002 Richard Moore 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef CHANNELSCANREGION_H
#define CHANNELSCANREGION_H

#include 

/**
 * Loader for region defined tuner settings.
 *
 * @author Richard Moore, 
 * @version $Id: channelscannerregion.h,v 1.3 2002/03/19 00:57:50 rich Exp $
 */
class ChannelScannerRegion
{
public:
    enum PictureFormat {
	NTSC, PAL, SECAM, UNKNOWN
    };

    ChannelScannerRegion();
    ~ChannelScannerRegion();

    bool load( const QString &filename );

    /**
     * Move to the first defined tuning.
     */
    bool first();

    /**
     * Move to the next defined tuning.
     */
    bool next();

    //
    // Information about the region.
    //
    QString name() const { return regName; }
    PictureFormat format() const { return fmt; }

    //
    // Information about the current tuning
    //
    QString id() const { return label; }
    unsigned long frequency() const { return freq/16; }

protected:
    bool setup();

    bool readTuning();
    bool readInfo();

    unsigned long readTextULong( const QDomElement &elem, const QString &tag );
    QString readText( const QDomElement &elem, const QString &tag );
    QDomElement readElement( const QDomNode &n, const QString &tag );

private:
    QDomDocument doc;
    QDomElement info;
    QDomElement tunings;

    // Current region
    QString regName;
    PictureFormat fmt;

    // Current item
    QDomElement elem;
    QString label;
    unsigned long freq;
};

#endif // CHANNELSCANREGION_H










Generated by: rich on pegasus on Wed Mar 20 03:16:53 2002, using kdoc 2.0a53.