User GUI

Top  Previous  Next

Girder has a built in configurable user GUI (or graphical user interface). This is designed the be used by the end-user. Someone who needs to operate the automation system but doesn't want to see Girder. Someone who wants to see pretty designs.

 

The User GUI uses the industry standard QML format. Looking at these files you'll notice they look a lot like Javascript with extra's. Which is exactly what they are. You can use the Qt Creator to create the QML files and load them in Girder.

 

Functions available in QML:

"girder" object:

SLOTS:

   void quit( );

   void sendEvent( const QString & eventString, int eventDevice, int keyMod, const QStringList & payloads = QStringList());

   void triggerNode( const QString & fileId, int nodeId);

   void sendLog(int level, const QString & source, const QString & message, const QString & fileId, int nodeId);

   void requestUpdateControlValue( quint64 controlId, const QString & value, const QString & sender);

PROPERTIES

   QString url

SIGNALS:

   void event(int eventDevice, QString eventString, int keyMod, QStringList payloads);

   void closeRequest();

   void urlChanged();

"kv" object:

SLOTS:

   virtual Promixis::IKVObject * value ( const QString & key ) = 0;

   virtual void preload( const QString & match ) = 0;

 

Promixis::IKVObject

PROPERTIES:

 QString val

 bool isDefined

SIGNALS:

   void valChanged();

   void isDefinedChanged();

 

"mbFactory" object of type IMBFactory

IMBFactory

class IMBFactory : public QObject

{

   Q_OBJECT

public:

  explicit IMBFactory(QObject *parent = 0);

 

  virtual QList<IMediaBridge*> mediabridges() = 0;

 

   Q_PROPERTY(QList<IMediaBridge*> mediabridges READ mediabridges NOTIFY mediaBridgesChanged )

signals:

  void mediaBridgesChanged();

public slots:

  virtual bool add( const QString & url ) = 0;

};

IMediaBridge

class IMediaBridge : public QObject

{

   Q_OBJECT

 

public:

  explicit IMediaBridge(QObject *parent = 0);

 

  virtual bool isConnected() const = 0;

  virtual QList<IMBZone*> zones() const = 0;

  virtual IMBItem * albumRoot() = 0;

  virtual IMBItem * genresRoot() = 0;

  virtual IMBItem * artistsRoot() = 0;

  virtual IMBItem * playingNow() = 0;

  virtual IMBItem * playlists() = 0;

  virtual QString name() const = 0;

  virtual IMBPage * page() = 0;

  virtual void setPassword( const QString & password ) = 0;

  virtual QString password() const = 0;

  virtual int zoneCount () const = 0;

 

  /* 0 = No image

    * 1 = Small

    * 2 = Medium

    * 3 = Large

    * 4 = Full

    */

  virtual void setDefaultImageSize(int size ) = 0;

  virtual int defaultImageSize() const = 0;

 

   Q_PROPERTY(QString name READ name NOTIFY nameChanged)

   Q_PROPERTY(bool isConnected READ isConnected NOTIFY isConnectedChanged )

   Q_PROPERTY(QList<IMBZone*> zones READ zones NOTIFY zonesChanged )

   Q_PROPERTY(IMBItem * albumRoot READ albumRoot NOTIFY albumRootChanged )

   Q_PROPERTY(IMBItem * genresRoot READ genresRoot NOTIFY generesRootChanged )

   Q_PROPERTY(IMBItem * artistsRoot READ artistsRoot NOTIFY artistsRootChanged )

   Q_PROPERTY(IMBItem * playingNow READ playingNow NOTIFY playingNowChanged )

   Q_PROPERTY(IMBItem * playlists READ playlists NOTIFY playlistsChanged )

   Q_PROPERTY(int defaultImageSize READ defaultImageSize WRITE setDefaultImageSize NOTIFY defaultImageSizeChanged)

   Q_PROPERTY(IMBPage * page READ page NOTIFY pageChanged)

   Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)

   Q_PROPERTY(int zoneCount READ zoneCount NOTIFY zoneCountChanged)

 

signals:

  void isConnectedChanged(bool isConnected);

  void zonesChanged( );

  void albumRootChanged();

  void generesRootChanged();

  void artistsRootChanged();

  void playingNowChanged();

  void playlistsChanged();

  void nameChanged();

  void pageChanged();

  void defaultImageSizeChanged();

  void passwordChanged();

  void zoneCountChanged();

 

public slots:

  virtual void connect() = 0;

  virtual void disconnect() = 0;  

};

IMBZone

class IMBZone : public QObject

{

   Q_OBJECT

   QString m_Name;

public:

 

  explicit IMBZone(QObject *parent = 0);  

 

  virtual void setName( const QString & name );

  virtual QString name() const;

 

  virtual void setVolume( int volume ) = 0;

  virtual int volume() const = 0;

  virtual void setMuted ( bool muted ) = 0;

  virtual bool muted() const = 0;

 

  virtual QString currentTrack ( ) const = 0;

  virtual QString currentAlbum ( ) const = 0;

  virtual QString currentArtist( ) const = 0;

  virtual QTime currentDuration( ) const = 0;

  virtual QTime currentPosition( ) const = 0;

  virtual bool isPlaying( ) const = 0;  

  virtual QString currentCoverUrl ( ) const = 0;

 

   Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)

   Q_PROPERTY(bool muted READ muted WRITE setMuted NOTIFY mutedChanged)

   Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)

 

   Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged )

   Q_PROPERTY(QString currentTrack READ currentTrack NOTIFY currentTrackChanged )

   Q_PROPERTY(QString currentArtist READ currentArtist NOTIFY currentArtistChanged )

   Q_PROPERTY(QString currentAlbum READ currentAlbum NOTIFY currentAlbumChanged )

   Q_PROPERTY(QTime currentDuration READ currentDuration NOTIFY currentDurationChanged )

   Q_PROPERTY(QTime currentPosition READ currentPosition NOTIFY currentPositionChanged )  

   Q_PROPERTY(QString currentCoverUrl READ currentCoverUrl NOTIFY currentCoverUrlChanged )

 

 

signals:

  void nameChanged( QString name );

  void mutedChanged( bool muted );

  void volumeChanged( int volume );

  void currentTrackChanged( QString track );

  void currentArtistChanged( QString artist);

  void currentAlbumChanged( QString album );

  void currentDurationChanged(QTime duration);

  void currentPositionChanged(QTime position);

  void isPlayingChanged(bool isPlaying);

  void currentCoverUrlChanged();

 

public slots:

 

  virtual void play() = 0;

  virtual void next() = 0;

  virtual void previous() = 0;

  virtual void pause() = 0;

  virtual void stop() = 0;

 

  virtual void play( IMBItem * item ) = 0;

  virtual void playAll( IMBPage * item ) = 0;

  virtual void add( IMBItem * item ) = 0;

  virtual void addAll( IMBPage * item ) = 0;

};

IMBPage

class IMBPage : public QObject

{

   Q_OBJECT

public:

  explicit IMBPage(QObject *parent = 0);

 

  virtual QList<IMBItem*> items() = 0;

  virtual int count() const = 0;

  virtual void setCount(int count) = 0;

  virtual int requestedCount() const = 0;

  virtual void setRequestedCount( int count ) = 0;

  virtual int startIndex() const = 0;

  virtual void setStartIndex(int index) = 0;

  virtual void setCoverImageSize ( int size ) = 0;

  virtual int coverImageSize( ) const = 0;

  virtual QString name () const = 0;

  virtual void setName( const QString & name ) = 0;

  virtual QString coverUrl ( ) const = 0;

 

  /* 0 = No image

    * 1 = Small

    * 2 = Medium

    * 3 = Large

    * 4 = Full

    */

  virtual void setImageSize ( int size ) = 0;

  virtual int imageSize( ) const =0;

 

 

   Q_PROPERTY(QList<IMBItem*> items READ items NOTIFY itemsChanged)

   Q_PROPERTY(int count READ count NOTIFY countChanged)

   Q_PROPERTY(int requestedCount READ requestedCount WRITE setRequestedCount NOTIFY requestedCountChanged)

   Q_PROPERTY(int startIndex READ startIndex WRITE setStartIndex NOTIFY startIndexChanged)

   Q_PROPERTY(int imageSize READ imageSize WRITE setImageSize NOTIFY imageSizeChanged)

   Q_PROPERTY(int coverImageSize READ coverImageSize WRITE setCoverImageSize NOTIFY coverImageSizeChanged)

   Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged )

   Q_PROPERTY(QString coverUrl READ coverUrl NOTIFY coverUrlChanged )

 

signals:

 

  void itemsChanged();

  void countChanged(int count);

  void requestedCountChanged(int count);

  void startIndexChanged(int index);

  void imageSizeChanged(int size);

  void nameChanged(QString name);

  void coverUrlChanged(QString cover);

  void coverImageSizeChanged(int size);

 

 

public slots:

  virtual void loadCover() = 0;

  virtual void loadItems( IMBItem * parent) = 0;

  virtual bool back() = 0;

};

IMBItem

class IMBItem : public QObject

{

   Q_OBJECT

   QString m_Name;  

  bool m_IsFile;

public:  

  explicit IMBItem(QObject *parent = 0);

 

  virtual void setName( const QString & name );

  virtual QString name() const;

  virtual bool isFile ( ) const;

  virtual void setIsFile( bool isFile );

  virtual QString coverUrl ( ) const = 0;

  virtual int subCount() const = 0;

 

   Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)

   Q_PROPERTY(bool isFile READ isFile NOTIFY isFileChanged)

   Q_PROPERTY(QString coverUrl READ coverUrl NOTIFY coverUrlChanged)

   Q_PROPERTY(int subCount READ subCount NOTIFY subCountchanged)

 

signals:  

  void nameChanged( QString name );

  void isFileChanged( bool isFile );

  void coverUrlChanged(QString url);

  void subCountchanged(int subCount);

public slots:

 

};