Ticket #1828: 1828-v2.patch

File 1828-v2.patch, 63.0 KB (added by danielk, 14 years ago)

Patch that just adds recorder keyed picture attributes

  • mythplugins/mythweb/includes/mythbackend.php

     
    1717
    1818// MYTH_PROTO_VERSION is defined in libmyth in mythtv/libs/libmyth/mythcontext.h
    1919// and should be the current MythTV protocol version.
    20     define('MYTH_PROTO_VERSION', 29);
     20    define('MYTH_PROTO_VERSION', 30);
    2121
    2222// NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
    2323// the number of items in a ProgramInfo QStringList group used by
  • mythtv/libs/libmythtv/tv.h

     
    5454
    5555QString StateToString(TVState state);
    5656
     57typedef enum PictureAdjustType
     58{
     59    kAdjustingPicture_None = 0,
     60    kAdjustingPicture_Playback,
     61    kAdjustingPicture_Channel,
     62    kAdjustingPicture_Recording,
     63} PictureAdjustType;
     64QString toTypeString(PictureAdjustType type);
     65QString toTitleString(PictureAdjustType type);
     66
     67typedef enum PictureAttribute
     68{
     69    kPictureAttribute_None = 0,
     70    kPictureAttribute_MIN = 1,
     71    kPictureAttribute_Brightness = 1,
     72    kPictureAttribute_Contrast,
     73    kPictureAttribute_Colour,
     74    kPictureAttribute_Hue,
     75    kPictureAttribute_Volume,
     76    kPictureAttribute_MAX
     77} PictureAttribute;
     78QString toString(PictureAttribute index);
     79
    5780#endif
  • mythtv/libs/libmythtv/tv_play.h

     
    215215    void ChangeVolume(bool up);
    216216    void ToggleMute(void);
    217217    void ToggleLetterbox(int letterboxMode = -1);
    218     void ChangeContrast(bool up, bool recorder);
    219     void ChangeBrightness(bool up, bool recorder);
    220     void ChangeColour(bool up, bool recorder);
    221     void ChangeHue(bool up, bool recorder);
    222218
    223219    bool FillMenuTracks(OSDGenericTree*, uint type);
    224220    void ChangeTrack(uint type, int dir);
     
    334330    void ToggleRecord(void);
    335331    void BrowseChannel(const QString &channum);
    336332
    337     void DoTogglePictureAttribute(void);
    338     void DoToggleRecPictureAttribute(void);
    339     void DoChangePictureAttribute(int control, bool up, bool rec);
     333    void DoTogglePictureAttribute(int type);
     334    void DoChangePictureAttribute(int type, int control, bool up);
    340335
    341336    void BuildOSDTreeMenu(void);
    342337    void ShowOSDTreeMenu(void);
     
    409404    bool doSmartForward;
    410405    bool queuedTranscode;
    411406    bool getRecorderPlaybackInfo; ///< Main loop should get recorderPlaybackInfo
    412     int picAdjustment;   ///< Player pict attr to modify (on arrow left or right)
    413     int recAdjustment;   ///< Which recorder picture attribute to modify...
     407    int adjustingPicture;
     408    ; ///< picture attribute to modify (on arrow left or right)
     409    int adjustingPictureAttribute;
    414410
    415411    bool ignoreKeys;
    416412    bool needToSwapPIP;
  • mythtv/libs/libmythtv/channel.h

     
    4040    bool SwitchToInput(int newcapchannel, bool setstarting);
    4141
    4242    // Picture attributes.
    43     void SetBrightness(void);
    44     void SetContrast(void);
    45     void SetColour(void);
    46     void SetHue(void);
    47     int  ChangeBrightness(bool up);
    48     int  ChangeColour(bool up);
    49     int  ChangeContrast(bool up);
    50     int  ChangeHue(bool up);
     43    bool InitPictureAttributes(void);
     44    int  GetPictureAttribute(const QString db_col_name) const;
     45    int  ChangePictureAttribute(int, const QString db_col_name, bool up);
    5146
    5247    // PID caching
    5348    void SaveCachedPids(const pid_cache_t&) const;
     
    6156    bool IsTuned(void) const;
    6257  private:
    6358    // Helper Sets
    64     void SetColourAttribute(int attrib, const char *name);
    6559    void SetFreqTable(const int index);
    6660    int  SetFreqTable(const QString &name);
    6761    bool SetInputAndFormat(int newcapchannel, QString newFmt);
    6862
    6963    // Helper Gets
    70     unsigned short *GetV4L1Field(int attrib, struct video_picture &vid_pic);
    7164    int  GetCurrentChannelNum(const QString &channame);
    7265    QString GetFormatForChannel(QString channum,
    7366                                QString inputname);
    7467
    7568    // Helper Commands
    76     int  ChangeColourAttribute(int attrib, const char *name, bool up);
     69    bool InitPictureAttribute(const QString db_col_name);
    7770    bool TuneTo(const QString &chan, int finetune);
    7871    bool InitializeInputs(void);
    7972
     
    8174    // Data
    8275    QString     device;
    8376    int         videofd;
     77    QString     device_name;
     78    QString     driver_name;
     79    QMap<QString,int> pict_attr_default;
    8480
    8581    struct CHANLIST *curList; 
    8682    int         totalChannels;
  • mythtv/libs/libmythtv/dbcheck.cpp

     
    1010#include "mythdbcon.h"
    1111
    1212/// This is the DB schema version expected by the running MythTV instance.
    13 const QString currentDatabaseVersion = "1137";
     13const QString currentDatabaseVersion = "1138";
    1414
    1515static bool UpdateDBVersionNumber(const QString &newnumber);
    1616static bool performActualUpdate(const QString updates[], QString version,
     
    22022202            return false;
    22032203    }
    22042204
     2205    if (dbver == "1137")
     2206    {
     2207        const QString updates[] = {
     2208"ALTER TABLE capturecard ADD contrast   INT NOT NULL default '0';",
     2209"ALTER TABLE capturecard ADD brightness INT NOT NULL default '0';",
     2210"ALTER TABLE capturecard ADD colour     INT NOT NULL default '0';",
     2211"ALTER TABLE capturecard ADD hue        INT NOT NULL default '0';",
     2212"",
     2213};
     2214
     2215       if (!performActualUpdate(updates, "1138", dbver))
     2216            return false;
     2217    }
     2218
    22052219//"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21
    22062220//"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21
    22072221//"ALTER TABLE cardinput DROP COLUMN  preference;" in 0.22
  • mythtv/libs/libmythtv/channelbase.h

     
    129129        { StoreInputChannels(inputs); }
    130130
    131131    // Picture attribute settings
    132     virtual void SetBrightness(void) {};
    133     virtual void SetColour(void) {};
    134     virtual void SetContrast(void) {};
    135     virtual void SetHue(void) {};
    136     virtual int  ChangeBrightness(bool up) { (void)up; return 0; };
    137     virtual int  ChangeColour(bool up)     { (void)up; return 0; };
    138     virtual int  ChangeContrast(bool up)   { (void)up; return 0; };
    139     virtual int  ChangeHue(bool up)        { (void)up; return 0; };
     132    virtual bool InitPictureAttributes(void) { return false; }
     133    virtual int  GetPictureAttribute(const QString) const { return 0; }
     134    virtual int  ChangePictureAttribute(int,const QString,bool) { return 0; }
    140135
    141136    bool CheckChannel(const QString &channum, QString& inputName) const;
    142137
  • mythtv/libs/libmythtv/tv_play.cpp

     
    163163    REG_KEY("TV Playback", "TOGGLESTRETCH", "Toggle time stretch speed", "");
    164164    REG_KEY("TV Playback", "TOGGLEAUDIOSYNC",
    165165            "Turn on audio sync adjustment controls", "");
    166     REG_KEY("TV Playback", "TOGGLEPICCONTROLS", "Turn on the playback picture "
    167             "adjustment controls", "F");
    168     REG_KEY("TV Playback", "TOGGLERECCONTROLS", "Turn on the recording picture "
    169             "adjustment controls", "G");
     166    REG_KEY("TV Playback", "TOGGLEPICCONTROLS",
     167            "Playback picture adjustments",                    "F");
     168    REG_KEY("TV Playback", "TOGGLECHANCONTROLS",
     169            "Recording picture adjustments for this channel",  "Ctrl+G");
     170    REG_KEY("TV Playback", "TOGGLERECCONTROLS",
     171            "Recording picture adjustments for this recorder", "G");
    170172    REG_KEY("TV Playback", "TOGGLEEDIT", "Start Edit Mode", "E");
    171173    REG_KEY("TV Playback", "CYCLECOMMSKIPMODE", "Cycle Commercial Skip mode", "");
    172174    REG_KEY("TV Playback", "GUIDE", "Show the Program Guide", "S");
     
    233235
    234236  Global:   Return, Enter, Space, Esc
    235237
    236   Global:          F1,
    237   Playback: Ctrl-B,                  F7,F8,F9,F10,F11
    238   Teletext            F2,F3,F4,F5,F6,F7,F8
    239   ITV                 F2,F3,F4,F5,F6,F7
    240  */
     238  Global:   F1,
     239  Playback:                   F7,F8,F9,F10,F11
     240  Teletext     F2,F3,F4,F5,F6,F7,F8
     241  ITV          F2,F3,F4,F5,F6,F7
     242
     243  Playback: Ctrl-B,Ctrl-G
     244*/
    241245}
    242246
    243247void *SpawnDecode(void *param)
     
    274278      update_osd_pos(false), endOfRecording(false), requestDelete(false),
    275279      doSmartForward(false),
    276280      queuedTranscode(false), getRecorderPlaybackInfo(false),
    277       picAdjustment(kPictureAttribute_None),
    278       recAdjustment(kPictureAttribute_None),
     281      adjustingPicture(kAdjustingPicture_None),
     282      adjustingPictureAttribute(kPictureAttribute_None),
    279283      ignoreKeys(false), needToSwapPIP(false), needToJumpMenu(false),
    280284      // Channel Editing
    281285      chanEditMapLock(true), ddMapSourceId(0), ddMapLoaderRunning(false),
     
    21642168        return;
    21652169    }
    21662170
    2167     if (picAdjustment != kPictureAttribute_None)
     2171    if (adjustingPicture)
    21682172    {
    21692173        for (unsigned int i = 0; i < actions.size(); i++)
    21702174        {
     
    21722176            handled = true;
    21732177
    21742178            if (action == "LEFT")
    2175                 DoChangePictureAttribute(picAdjustment, false, false);
     2179                DoChangePictureAttribute(adjustingPicture,
     2180                                         adjustingPictureAttribute, false);
    21762181            else if (action == "RIGHT")
    2177                 DoChangePictureAttribute(picAdjustment, true, false);
     2182                DoChangePictureAttribute(adjustingPicture,
     2183                                         adjustingPictureAttribute, true);
    21782184            else
    21792185                handled = false;
    21802186        }
    21812187    }
    2182    
    2183     if (recAdjustment)
    2184     {
    2185         for (unsigned int i = 0; i < actions.size(); i++)
    2186         {
    2187             QString action = actions[i];
    2188             handled = true;
    2189 
    2190             if (action == "LEFT")
    2191                 DoChangePictureAttribute(recAdjustment, false, true);
    2192             else if (action == "RIGHT")
    2193                 DoChangePictureAttribute(recAdjustment, true, true);
    2194             else
    2195                 handled = false;
    2196         }
    2197     }
    21982188   
    21992189    if (stretchAdjustment)
    22002190    {
     
    23192309            ChangeAudioSync(0);   // just display
    23202310        else if (action == "TOGGLEPICCONTROLS")
    23212311        {
    2322             if (usePicControls)
    2323             {
    2324                 picAdjustment += 1;
    2325                 if (picAdjustment >= kPictureAttribute_MAX)
    2326                     picAdjustment = kPictureAttribute_MIN;
    2327                 DoTogglePictureAttribute();
    2328             }
     2312            DoTogglePictureAttribute(kAdjustingPicture_Playback);
    23292313        }
    23302314        else if (action == "NEXTSCAN")
    23312315        {
     
    26942678                if (!CommitQueuedInput())
    26952679                    handled = false;
    26962680            }
     2681            else if (action == "TOGGLECHANCONTROLS")
     2682                DoTogglePictureAttribute(kAdjustingPicture_Channel);
    26972683            else if (action == "TOGGLERECCONTROLS")
    2698                 DoToggleRecPictureAttribute();
     2684                DoTogglePictureAttribute(kAdjustingPicture_Recording);
    26992685            else if (action == "TOGGLEBROWSE" && pseudoLiveTVState[aindx])
    27002686                ShowOSDTreeMenu();
    27012687            else
     
    48694855    }
    48704856}
    48714857
    4872 void TV::ChangeBrightness(bool up, bool recorder)
    4873 {
    4874     int brightness;
    4875     QString text;
    4876 
    4877     if (GetOSD())
    4878     {
    4879         if (recorder)
    4880         {
    4881             brightness = activerecorder->ChangeBrightness(up);
    4882             text = QString(tr("Brightness (REC) %1 %")).arg(brightness);
    4883             GetOSD()->ShowStatus(brightness * 10, true, tr("Adjust Recording"),
    4884                 text, 5, kOSDFunctionalType_RecPictureAdjust);
    4885         }
    4886         else
    4887         {
    4888             brightness = nvp->getVideoOutput()->ChangeBrightness(up);
    4889             gContext->SaveSetting("PlaybackBrightness", brightness);
    4890             text = QString(tr("Brightness %1 %")).arg(brightness);
    4891             GetOSD()->ShowStatus(brightness * 10, true, tr("Adjust Picture"),
    4892                 text, 5, kOSDFunctionalType_PictureAdjust);
    4893         }
    4894 
    4895         update_osd_pos = false;
    4896     }
    4897 }
    4898 
    4899 void TV::ChangeContrast(bool up, bool recorder)
    4900 {
    4901     int contrast;
    4902     QString text;
    4903 
    4904     if (GetOSD())
    4905     {
    4906         if (recorder)
    4907         {
    4908             contrast = activerecorder->ChangeContrast(up);
    4909             text = QString(tr("Contrast (REC) %1 %")).arg(contrast);
    4910             GetOSD()->ShowStatus(contrast * 10, true, tr("Adjust Recording"),
    4911                 text, 5, kOSDFunctionalType_RecPictureAdjust);
    4912         }
    4913         else
    4914         {
    4915             contrast = nvp->getVideoOutput()->ChangeContrast(up);
    4916             gContext->SaveSetting("PlaybackContrast", contrast);
    4917             text = QString(tr("Contrast %1 %")).arg(contrast);
    4918             GetOSD()->ShowStatus(contrast * 10, true, tr("Adjust Picture"),
    4919                 text, 5, kOSDFunctionalType_PictureAdjust);
    4920         }
    4921 
    4922         update_osd_pos = false;
    4923     }
    4924 }
    4925 
    4926 void TV::ChangeColour(bool up, bool recorder)
    4927 {
    4928     int colour;
    4929     QString text;
    4930 
    4931     if (GetOSD())
    4932     {
    4933         if (recorder)
    4934         {
    4935             colour = activerecorder->ChangeColour(up);
    4936             text = QString(tr("Colour (REC) %1 %")).arg(colour);
    4937             GetOSD()->ShowStatus(colour * 10, true, tr("Adjust Recording"),
    4938                 text, 5, kOSDFunctionalType_RecPictureAdjust);
    4939         }
    4940         else
    4941         {
    4942             colour = nvp->getVideoOutput()->ChangeColour(up);
    4943             gContext->SaveSetting("PlaybackColour", colour);
    4944             text = QString(tr("Colour %1 %")).arg(colour);
    4945             GetOSD()->ShowStatus(colour * 10, true, tr("Adjust Picture"),
    4946                 text, 5, kOSDFunctionalType_PictureAdjust);
    4947         }
    4948 
    4949         update_osd_pos = false;
    4950     }
    4951 }
    4952 
    4953 void TV::ChangeHue(bool up, bool recorder)
    4954 {
    4955     int hue;
    4956     QString text;
    4957 
    4958     if (GetOSD())
    4959     {
    4960         if (recorder)
    4961         {
    4962             hue = activerecorder->ChangeHue(up);
    4963             text = QString(tr("Hue (REC) %1 %")).arg(hue);
    4964             GetOSD()->ShowStatus(hue * 10, true, tr("Adjust Recording"),
    4965                 text, 5, kOSDFunctionalType_RecPictureAdjust);
    4966         }
    4967         else
    4968         {
    4969             hue = nvp->getVideoOutput()->ChangeHue(up);
    4970             gContext->SaveSetting("PlaybackHue", hue);
    4971             text = QString(tr("Hue %1 %")).arg(hue);
    4972             GetOSD()->ShowStatus(hue * 10, true, tr("Adjust Picture"),
    4973                 text, 5, kOSDFunctionalType_PictureAdjust);
    4974         }
    4975 
    4976         update_osd_pos = false;
    4977     }
    4978 }
    4979 
    49804858void TV::ChangeVolume(bool up)
    49814859{
    49824860    AudioOutput *aud = nvp->getAudioOutput();
     
    56005478{
    56015479    switch (osdType)
    56025480    {
    5603         case kOSDFunctionalType_RecPictureAdjust:
    5604             recAdjustment = kPictureAttribute_None;
    5605             break;
    56065481        case kOSDFunctionalType_PictureAdjust:
    5607             picAdjustment = kPictureAttribute_None;
     5482            adjustingPicture = kAdjustingPicture_None;
     5483            adjustingPictureAttribute = kPictureAttribute_None;
    56085484            break;
    56095485        case kOSDFunctionalType_SmartForward:
    56105486            doSmartForward = false;
     
    56205496    }
    56215497}
    56225498
    5623 void TV::DoTogglePictureAttribute(void)
     5499void TV::DoTogglePictureAttribute(int itype)
    56245500{
    5625     OSDSet *oset;
    5626     int value = 0;
     5501    PictureAdjustType type = (PictureAdjustType) itype;
    56275502
    5628     if (GetOSD())
    5629     {
    5630         oset = GetOSD()->GetSet("status");
    5631         QString title = tr("Adjust Picture");
    5632         QString picName;
     5503    adjustingPicture = type;
    56335504
    5634         AudioOutput *aud = NULL;
    5635         switch (picAdjustment)
    5636         {
    5637             case kPictureAttribute_Brightness:
    5638                 value = nvp->getVideoOutput()->GetCurrentBrightness();
    5639                 picName = QString("%1 %2 %").arg(tr("Brightness")).arg(value);
    5640                 break;
    5641             case kPictureAttribute_Contrast:
    5642                 value = nvp->getVideoOutput()->GetCurrentContrast();
    5643                 picName = QString("%1 %2 %").arg(tr("Contrast")).arg(value);
    5644                 break;
    5645             case kPictureAttribute_Colour:
    5646                 value = nvp->getVideoOutput()->GetCurrentColour();
    5647                 picName = QString("%1 %2 %").arg(tr("Colour")).arg(value);
    5648                 break;
    5649             case kPictureAttribute_Hue:
    5650                 value = nvp->getVideoOutput()->GetCurrentHue();
    5651                 picName = QString("%1 %2 %").arg(tr("Hue")).arg(value);
    5652                 break;
    5653             case kPictureAttribute_Volume:
    5654                 aud = nvp->getAudioOutput();
    5655                 value = (aud) ? (aud->GetCurrentVolume()) : 99;
    5656                 title = tr("Adjust Volume");
    5657                 picName = QString("%1 %2 %").arg(tr("Volume")).arg(value);
    5658                 break;
    5659         }
    5660         GetOSD()->ShowStatus(value*10, true, title, picName, 5,
    5661                         kOSDFunctionalType_PictureAdjust);
    5662         update_osd_pos = false;
     5505    adjustingPictureAttribute += 1;
     5506    if ((adjustingPictureAttribute >= kPictureAttribute_MAX) ||
     5507        ((type >= kAdjustingPicture_Channel) &&
     5508         (adjustingPictureAttribute > kPictureAttribute_Hue)))
     5509    {
     5510        adjustingPictureAttribute = kPictureAttribute_MIN;
    56635511    }
    5664 }
    56655512
    5666 void TV::DoToggleRecPictureAttribute(void)
    5667 {
    5668     OSDSet *oset;
    5669     int value = 0;
    5670    
    5671     recAdjustment = (recAdjustment % 4) + 1;
    5672    
    5673     if (GetOSD())
     5513    PictureAttribute attr = (PictureAttribute) adjustingPictureAttribute;
     5514    QString title = toTitleString(type);
     5515
     5516    if (!GetOSD())
     5517        return;
     5518
     5519    GetOSD()->GetSet("status");
     5520
     5521    int value = 99;
     5522    if (nvp && (kAdjustingPicture_Playback == type))
    56745523    {
    5675         oset = GetOSD()->GetSet("status");
    5676         QString title = tr("Adjust Recording");
    5677         QString recName;
    5678      
    5679         switch (recAdjustment)
     5524        if (kPictureAttribute_Brightness == adjustingPictureAttribute)
     5525            value = nvp->getVideoOutput()->GetCurrentBrightness();
     5526        else if (kPictureAttribute_Contrast == adjustingPictureAttribute)
     5527            value = nvp->getVideoOutput()->GetCurrentContrast();
     5528        else if (kPictureAttribute_Colour == adjustingPictureAttribute)
     5529            value = nvp->getVideoOutput()->GetCurrentColour();
     5530        else if (kPictureAttribute_Hue == adjustingPictureAttribute)
     5531            value = nvp->getVideoOutput()->GetCurrentHue();
     5532        else if ((kPictureAttribute_Volume == adjustingPictureAttribute) &&
     5533                 nvp->getAudioOutput())
    56805534        {
    5681             case kPictureAttribute_Brightness:
    5682                 activerecorder->ChangeBrightness(true);
    5683                 value = activerecorder->ChangeBrightness(false);
    5684                 recName = QString("%1 %2 %3 %").arg(tr("Brightness"))
    5685                                   .arg(tr("(REC)")).arg(value);
    5686                 break;
    5687             case kPictureAttribute_Contrast:
    5688                 activerecorder->ChangeContrast(true);
    5689                 value = activerecorder->ChangeContrast(false);
    5690                 recName = QString("%1 %2 %3 %").arg(tr("Contrast"))
    5691                                   .arg(tr("(REC)")).arg(value);
    5692                 break;
    5693             case kPictureAttribute_Colour:
    5694                 activerecorder->ChangeColour(true);
    5695                 value = activerecorder->ChangeColour(false);
    5696                 recName = QString("%1 %2 %3 %").arg(tr("Colour"))
    5697                                   .arg(tr("(REC)")).arg(value);
    5698                 break;
    5699             case kPictureAttribute_Hue:
    5700                 activerecorder->ChangeHue(true);
    5701                 value = activerecorder->ChangeHue(false);
    5702                 recName = QString("%1 %2 %3 %").arg(tr("Hue"))
    5703                                   .arg(tr("(REC)")).arg(value);
    5704                 break;
     5535            value = nvp->getAudioOutput()->GetCurrentVolume();
     5536            title = tr("Adjust Volume");
    57055537        }
    5706         GetOSD()->ShowStatus(value * 10, true, title, recName, 5,
    5707                         kOSDFunctionalType_RecPictureAdjust);
    5708         update_osd_pos = false;
    57095538    }
     5539    else if (activerecorder && (kAdjustingPicture_Playback != type))
     5540    {
     5541        value = activerecorder->GetPictureAttribute(attr);
     5542    }
     5543
     5544    QString text = toString(attr) + " " + toTypeString(type) +
     5545        QString(" %1 %").arg(value);
     5546
     5547    GetOSD()->ShowStatus(value * 10, true, title, text, 5,
     5548                         kOSDFunctionalType_PictureAdjust);
     5549
     5550    update_osd_pos = false;
    57105551}
    57115552   
    5712 void TV::DoChangePictureAttribute(int control, bool up, bool rec)
     5553void TV::DoChangePictureAttribute(int itype, int control, bool up)
    57135554{
    5714     switch (control)
     5555    if (!GetOSD())
     5556        return;
     5557
     5558    PictureAdjustType type = (PictureAdjustType) itype;
     5559    PictureAttribute  attr = (PictureAttribute)  control;
     5560    int value = 99;
     5561
     5562    if (nvp && (kAdjustingPicture_Playback == type))
    57155563    {
    5716         case kPictureAttribute_Brightness:
    5717             ChangeBrightness(up, rec);
    5718             break;
    5719         case kPictureAttribute_Contrast:
    5720             ChangeContrast(up, rec);
    5721             break;
    5722         case kPictureAttribute_Colour:
    5723             ChangeColour(up, rec);
    5724             break;
    5725         case kPictureAttribute_Hue:
    5726             ChangeHue(up, rec);
    5727             break;
    5728         case kPictureAttribute_Volume:
     5564        if (kPictureAttribute_Brightness == control)
     5565        {
     5566            value = nvp->getVideoOutput()->ChangeBrightness(up);
     5567            gContext->SaveSetting("PlaybackBrightness", value);
     5568        }
     5569        else if (kPictureAttribute_Contrast == control)
     5570        {
     5571            value = nvp->getVideoOutput()->ChangeContrast(up);
     5572            gContext->SaveSetting("PlaybackContrast", value);
     5573        }
     5574        else if (kPictureAttribute_Colour == control)
     5575        {
     5576            value = nvp->getVideoOutput()->ChangeColour(up);
     5577            gContext->SaveSetting("PlaybackColour", value);
     5578        }
     5579        else if (kPictureAttribute_Hue == control)
     5580        {
     5581            value = nvp->getVideoOutput()->ChangeHue(up);
     5582            gContext->SaveSetting("PlaybackHue", value);
     5583        }
     5584        else if (kPictureAttribute_Volume == control)
     5585        {
    57295586            ChangeVolume(up);
    5730             break;
     5587            return;
     5588        }
    57315589    }
     5590    else if (activerecorder && (kAdjustingPicture_Playback != type))
     5591    {
     5592        value = activerecorder->ChangePictureAttribute(type, attr, up);
     5593    }
     5594
     5595    QString text = toString(attr) + " " + toTypeString(type) +
     5596        QString(" %1 %").arg(value);
     5597
     5598    GetOSD()->ShowStatus(value * 10, true, toTitleString(type), text, 5,
     5599                         kOSDFunctionalType_PictureAdjust);
     5600
     5601    update_osd_pos = false;
    57325602}
    57335603
    57345604OSD *TV::GetOSD(void)
     
    62166086    }
    62176087    else if (action.left(17) == "TOGGLEPICCONTROLS")
    62186088    {
    6219         picAdjustment = action.right(1).toInt();
    6220         DoTogglePictureAttribute();
     6089        adjustingPictureAttribute = action.right(1).toInt() - 1;
     6090        DoTogglePictureAttribute(kAdjustingPicture_Playback);
    62216091    }
    62226092    else if (action.left(12) == "TOGGLEASPECT")
    62236093    {
  • mythtv/libs/libmythtv/remoteencoder.h

     
    4242    QStringList GetInputs(void);
    4343    QString GetInput(void);
    4444    QString SetInput(QString);
    45     int ChangeContrast(bool direction);
    46     int ChangeBrightness(bool direction);
    47     int ChangeColour(bool direction);
    48     int ChangeHue(bool direction);
     45    int  GetPictureAttribute(int attr);
     46    int  ChangePictureAttribute(int type, int attr, bool direction);
    4947    void ChangeChannel(int channeldirection);
    5048    void ChangeDeinterlacer(int deint_mode);
    5149    void ToggleChannelFavorite(void);
  • mythtv/libs/libmythtv/remoteencoder.cpp

     
    99#include "util.h"
    1010#include "mythcontext.h"
    1111#include "signalmonitor.h"
     12#include "videooutbase.h"
    1213
    1314RemoteEncoder::RemoteEncoder(int num, const QString &host, short port)
    1415    : recordernum(num),       controlSock(NULL),      remotehost(host),
     
    449450    return timeout;
    450451}
    451452
    452 /** \fn RemoteEncoder::ChangeContrast(bool)
    453  *  \brief Changes contrast of a recording.
    454  *
    455  *  Note: In practice this only works with frame grabbing recorders.
    456  *
    457  *  \return contrast if it succeeds, -1 otherwise.
    458  */
    459 int RemoteEncoder::ChangeContrast(bool direction)
    460 {
    461     QStringList strlist = QString("QUERY_RECORDER %1").arg(recordernum);
    462     strlist << "CHANGE_CONTRAST";
    463     strlist << QString::number((int)direction);
    464453
    465     SendReceiveStringList(strlist);
    466 
    467     int retval = strlist[0].toInt();
    468     return retval;
    469 }
    470 
    471 /** \fn RemoteEncoder::ChangeBrightness(bool)
    472  *  \brief Changes the brightness of a recording.
    473  *
    474  *   Note: In practice this only works with frame grabbing recorders.
    475  *
    476  *  \return brightness if it succeeds, -1 otherwise.
    477  */
    478 int RemoteEncoder::ChangeBrightness(bool direction)
     454int RemoteEncoder::GetPictureAttribute(int attr)
    479455{
    480456    QStringList strlist = QString("QUERY_RECORDER %1").arg(recordernum);
    481     strlist << "CHANGE_BRIGHTNESS";
    482     strlist << QString::number((int)direction);
    483457
     458    if (kPictureAttribute_Contrast == attr)
     459        strlist << "GET_CONTRAST";
     460    else if (kPictureAttribute_Brightness == attr)
     461        strlist << "GET_BRIGHTNESS";
     462    else if (kPictureAttribute_Colour == attr)
     463        strlist << "GET_COLOUR";
     464    else if (kPictureAttribute_Hue == attr)
     465        strlist << "GET_HUE";
     466    else
     467        return -1;
     468
    484469    SendReceiveStringList(strlist);
    485470
    486471    int retval = strlist[0].toInt();
    487472    return retval;
    488473}
    489474
    490 /** \fn RemoteEncoder::ChangeColour(bool)
    491  *  \brief Changes the colour phase of a recording.
     475/** \fn RemoteEncoder::ChangeContrast(int, int, bool)
     476 *  \brief Changes brightness/contrast/colour/hue of a recording.
    492477 *
    493  *   Note: In practice this only works with frame grabbing recorders.
     478 *  Note: In practice this only works with frame grabbing recorders.
    494479 *
    495  *  \return colour if it succeeds, -1 otherwise.
     480 *  \return contrast if it succeeds, -1 otherwise.
    496481 */
    497 int RemoteEncoder::ChangeColour(bool direction)
     482int RemoteEncoder::ChangePictureAttribute(int type, int attr, bool up)
    498483{
    499484    QStringList strlist = QString("QUERY_RECORDER %1").arg(recordernum);
    500     strlist << "CHANGE_COLOUR";
    501     strlist << QString::number((int)direction);
    502485
    503     SendReceiveStringList(strlist);
     486    if (kPictureAttribute_Contrast == attr)
     487        strlist << "CHANGE_CONTRAST";
     488    else if (kPictureAttribute_Brightness == attr)
     489        strlist << "CHANGE_BRIGHTNESS";
     490    else if (kPictureAttribute_Colour == attr)
     491        strlist << "CHANGE_COLOUR";
     492    else if (kPictureAttribute_Hue == attr)
     493        strlist << "CHANGE_HUE";
     494    else
     495        return -1;
    504496
    505     int retval = strlist[0].toInt();
    506     return retval;
    507 }
     497    strlist << QString::number(type);
     498    strlist << QString::number((int)up);
    508499
    509 /** \fn RemoteEncoder::ChangeHue(bool)
    510  *  \brief Changes the hue of a recording.
    511  *
    512  *   Note: In practice this only works with frame grabbing recorders.
    513  *
    514  *  \return hue if it succeeds, -1 otherwise.
    515  */
    516 int RemoteEncoder::ChangeHue(bool direction)
    517 {
    518     QStringList strlist = QString("QUERY_RECORDER %1").arg(recordernum);
    519     strlist << "CHANGE_HUE";
    520     strlist << QString::number((int)direction);
    521 
    522500    SendReceiveStringList(strlist);
    523501
    524502    int retval = strlist[0].toInt();
  • mythtv/libs/libmythtv/videoout_xv.cpp

     
    3636#include "mythconfig.h"
    3737#include "mythcontext.h"
    3838#include "filtermanager.h"
     39#define IGNORE_TV_PLAY_REC
     40#include "tv.h"
    3941
    4042#define LOC QString("VideoOutputXv: ")
    4143#define LOC_ERR QString("VideoOutputXv Error: ")
  • mythtv/libs/libmythtv/tv_rec.cpp

     
    26382638    }
    26392639}
    26402640
    2641 /** \fn TVRec::ChangeContrast(bool)
    2642  *  \brief Changes contrast of a recording.
     2641/** \fn TVRec::ChangePictureAttribute(PictureAdjustType,PictureAttribute,bool)
     2642 *  \brief Returns current value [0,100] if it succeeds, -1 otherwise.
    26432643 *
    26442644 *  Note: In practice this only works with frame grabbing recorders.
    2645  *
    2646  *  \return contrast if it succeeds, -1 otherwise.
    26472645 */
    2648 int TVRec::ChangeContrast(bool direction)
     2646int TVRec::GetPictureAttribute(PictureAttribute attr)
    26492647{
    26502648    QMutexLocker lock(&stateChangeLock);
    2651 
    26522649    if (!channel)
    26532650        return -1;
    26542651
    2655     int ret = channel->ChangeContrast(direction);
    2656     return ret;
    2657 }
     2652    int ret = -1;
     2653    if (kPictureAttribute_Brightness == attr)
     2654        ret = channel->GetPictureAttribute("brightness");
     2655    else if (kPictureAttribute_Contrast == attr)
     2656        ret = channel->GetPictureAttribute("contrast");
     2657    else if (kPictureAttribute_Colour == attr)
     2658        ret = channel->GetPictureAttribute("colour");
     2659    else if (kPictureAttribute_Hue == attr)
     2660        ret = channel->GetPictureAttribute("hue");
    26582661
    2659 /** \fn TVRec::ChangeBrightness(bool)
    2660  *  \brief Changes the brightness of a recording.
    2661  *
    2662  *  Note: In practice this only works with frame grabbing recorders.
    2663  *
    2664  *  \return brightness if it succeeds, -1 otherwise.
    2665  */
    2666 int TVRec::ChangeBrightness(bool direction)
    2667 {
    2668     QMutexLocker lock(&stateChangeLock);
    2669 
    2670     if (!channel)
     2662    if (ret < 0)
    26712663        return -1;
    2672 
    2673     int ret = channel->ChangeBrightness(direction);
    2674     return ret;
     2664    return ret / 655;
    26752665}
    26762666
    2677 /** \fn TVRec::ChangeColour(bool)
    2678  *  \brief Changes the colour phase of a recording.
     2667/** \fn TVRec::ChangePictureAttribute(PictureAdjustType,PictureAttribute,bool)
     2668 *  \brief Changes brightness/contrast/colour/hue of a recording.
    26792669 *
    26802670 *  Note: In practice this only works with frame grabbing recorders.
    26812671 *
    2682  *  \return colour if it succeeds, -1 otherwise.
     2672 *  \return current value [0,100] if it succeeds, -1 otherwise.
    26832673 */
    2684 int TVRec::ChangeColour(bool direction)
     2674int TVRec::ChangePictureAttribute(PictureAdjustType type,
     2675                                  PictureAttribute  attr,
     2676                                  bool              direction)
    26852677{
    26862678    QMutexLocker lock(&stateChangeLock);
    2687 
    26882679    if (!channel)
    26892680        return -1;
    26902681
    2691     int ret = channel->ChangeColour(direction);
    2692     return ret;
    2693 }
     2682    int ret = -1;
     2683    if (kPictureAttribute_Brightness == attr)
     2684        ret = channel->ChangePictureAttribute(type, "brightness", direction);
     2685    else if (kPictureAttribute_Contrast == attr)
     2686        ret = channel->ChangePictureAttribute(type, "contrast", direction);
     2687    else if (kPictureAttribute_Colour == attr)
     2688        ret = channel->ChangePictureAttribute(type, "colour", direction);
     2689    else if (kPictureAttribute_Hue == attr)
     2690        ret = channel->ChangePictureAttribute(type, "hue", direction);
    26942691
    2695 /** \fn TVRec::ChangeHue(bool)
    2696  *  \brief Changes the hue of a recording.
    2697  *
    2698  *  Note: In practice this only works with frame grabbing recorders.
    2699  *
    2700  *  \return hue if it succeeds, -1 otherwise.
    2701  */
    2702 int TVRec::ChangeHue(bool direction)
    2703 {
    2704     QMutexLocker lock(&stateChangeLock);
    2705 
    2706     if (!channel)
     2692    if (ret < 0)
    27072693        return -1;
    2708 
    2709     int ret = channel->ChangeHue(direction);
    2710     return ret;
     2694    return ret / 655;
    27112695}
    27122696
    27132697/** \fn TVRec::GetConnectedInputs(void) const
     
    36763660#ifdef USING_V4L
    36773661    if (GetV4LChannel())
    36783662    {
    3679         channel->SetBrightness();
    3680         channel->SetContrast();
    3681         channel->SetColour();
    3682         channel->SetHue();
     3663        channel->InitPictureAttributes();
    36833664        CloseChannel();
    36843665    }
    36853666#endif
  • mythtv/libs/libmythtv/videooutbase.h

     
    7070    kCodec_SPECIAL_END,
    7171};
    7272
    73 enum PictureAttribute
    74 {
    75     kPictureAttribute_None = 0,
    76     kPictureAttribute_MIN = 1,
    77     kPictureAttribute_Brightness = 1,
    78     kPictureAttribute_Contrast,
    79     kPictureAttribute_Colour,
    80     kPictureAttribute_Hue,
    81     kPictureAttribute_Volume,
    82     kPictureAttribute_MAX
    83 };
    84 
    8573enum PIPLocations
    8674{
    8775    kPIPTopLeft = 0,
  • mythtv/libs/libmythtv/tv_rec.h

     
    212212    void SetChannel(QString name, uint requestType = kFlagDetect);
    213213
    214214    int SetSignalMonitoringRate(int msec, int notifyFrontend = 1);
    215     int ChangeColour(bool direction);
    216     int ChangeContrast(bool direction);
    217     int ChangeBrightness(bool direction);
    218     int ChangeHue(bool direction);
     215    int  GetPictureAttribute(PictureAttribute attr);
     216    int  ChangePictureAttribute(PictureAdjustType type, PictureAttribute attr,
     217                                bool direction);
    219218    bool CheckChannel(QString name) const;
    220219    bool ShouldSwitchToAnotherCard(QString chanid);
    221220    bool CheckChannelPrefix(const QString&,uint&,bool&,QString&);
  • mythtv/libs/libmythtv/tv.cpp

     
     1#include <algorithm>
     2using namespace std;
     3
    14#include "tv.h"
     5#include "tv_play.h"
     6#include "tv_rec.h"
    27
    38/** \fn StateToString(TVState state)
    49 *  \brief Returns a human readable QString representing a TVState.
     
    1924    }
    2025    return statestr;
    2126}
     27
     28QString toTypeString(PictureAdjustType type)
     29{
     30    const QString kPicAdjType[] =
     31    {
     32        "",
     33        "",
     34        QObject::tr("(CH)"),
     35        QObject::tr("(REC)"),
     36    };
     37
     38    return kPicAdjType[(int)type & 0x3];
     39}
     40
     41QString toTitleString(PictureAdjustType type)
     42{
     43    const QString kPicAdjTitles[] =
     44    {
     45        "",
     46        QObject::tr("Adjust Playback"),
     47        QObject::tr("Adjust Recorder"),
     48        QObject::tr("Adjust Recorder"),
     49    };
     50
     51    return kPicAdjTitles[(int)type & 0x3];
     52}
     53
     54QString toString(PictureAttribute index)
     55{
     56    const QString tbl[] =
     57    {
     58        QObject::tr("None"),
     59        QObject::tr("Brightness"),
     60        QObject::tr("Contrast"),
     61        QObject::tr("Colour"),
     62        QObject::tr("Hue"),
     63        QObject::tr("Volume"),
     64        QObject::tr("MAX"),
     65    };
     66
     67    int i = (int)index;
     68    i = max(i, (int) kPictureAttribute_None);
     69    i = min(i, (int) kPictureAttribute_MAX);
     70
     71    return tbl[i];
     72}
  • mythtv/libs/libmythtv/channel.cpp

     
    2929#include "channelutil.h"
    3030#include "cardutil.h"
    3131
     32#define DEBUG_ATTRIB 1
     33
    3234#define LOC QString("Channel(%1): ").arg(device)
    3335#define LOC_ERR QString("Channel(%1) Error: ").arg(device)
    3436
     
    4143 */
    4244
    4345Channel::Channel(TVRec *parent, const QString &videodevice)
    44     : ChannelBase(parent), device(videodevice), videofd(-1),
    45       curList(NULL), totalChannels(0),
    46       currentFormat(""), is_dtv(false), usingv4l2(false),
    47       defaultFreqTable(1)
     46    : ChannelBase(parent),
     47      device(videodevice),          videofd(-1),
     48      device_name(QString::null),   driver_name(QString::null),
     49      curList(NULL),                totalChannels(0),
     50      currentFormat(""),            is_dtv(false),
     51      usingv4l2(false),             defaultFreqTable(1)
    4852{
    4953}
    5054
     
    7175    }
    7276
    7377    usingv4l2 = CardUtil::hasV4L2(videofd);
     78    CardUtil::GetV4LInfo(videofd, device_name, driver_name);
     79    VERBOSE(VB_CHANNEL, LOC + QString("Device name '%1' driver '%2'.")
     80            .arg(device_name).arg(driver_name));
    7481
    7582    if (!InitializeInputs())
    7683    {
     
    495502    if (pParent)
    496503        pParent->SetVideoFiltersForChannel(GetCurrentSourceID(), chan);
    497504
    498     SetContrast();
    499     SetColour();
    500     SetBrightness();
    501     SetHue();
     505    InitPictureAttributes();
    502506
    503507    inputs[currentInputID]->startChanNum = curchannelname;
    504508
     
    903907    return ok;
    904908}
    905909
    906 unsigned short *Channel::GetV4L1Field(int attrib, struct video_picture &vid_pic)
     910static unsigned short *get_v4l1_field(
     911    int v4l2_attrib, struct video_picture &vid_pic)
    907912{
    908     switch (attrib)
     913    switch (v4l2_attrib)
    909914    {
    910915        case V4L2_CID_CONTRAST:
    911916            return &vid_pic.contrast;
     
    916921        case V4L2_CID_HUE:
    917922            return &vid_pic.hue;
    918923        default:
    919             VERBOSE(VB_IMPORTANT,
    920                     QString("Channel(%1)::SetColourAttribute(): "
    921                             "invalid attribute argument: %2\n").
    922                     arg(device).arg(attrib));
     924            VERBOSE(VB_IMPORTANT, "get_v4l1_field: "
     925                    "invalid attribute argument "<<v4l2_attrib);
    923926    }
    924927    return NULL;
    925928}
    926929
    927 void Channel::SetColourAttribute(int attrib, const char *name)
     930static int get_v4l2_attribute(const QString &db_col_name)
    928931{
     932    if ("brightness" == db_col_name)
     933        return V4L2_CID_BRIGHTNESS;
     934    else if ("contrast" == db_col_name)
     935        return V4L2_CID_SATURATION;
     936    else if ("colour" == db_col_name)
     937        return V4L2_CID_SATURATION;
     938    else if ("hue" == db_col_name)
     939        return V4L2_CID_HUE;
     940    return -1;
     941}
     942
     943bool Channel::InitPictureAttribute(const QString db_col_name)
     944{
    929945    if (!pParent || is_dtv)
    930         return;
     946        return false;
    931947
    932     QString field_name = name;
    933     int field = ChannelUtil::GetChannelValueInt(
    934         field_name, GetCurrentSourceID(), curchannelname);
     948    int v4l2_attrib = get_v4l2_attribute(db_col_name);
     949    if (v4l2_attrib == -1)
     950        return false;
    935951
     952    int cfield = ChannelUtil::GetChannelValueInt(
     953        db_col_name, GetCurrentSourceID(), curchannelname);
     954    int sfield = CardUtil::GetValueInt(
     955        db_col_name, GetCardID(), GetCurrentSourceID());
     956
     957    if ((cfield == -1) || (sfield == -1))
     958        return false;
     959
     960    int field = (cfield + sfield) & 0xFFFF;
     961
     962    QString loc = LOC +
     963        QString("InitPictureAttribute(%1): ").arg(db_col_name, 10);
     964    QString loc_err = LOC_ERR +
     965        QString("InitPictureAttribute(%1): ").arg(db_col_name, 10);
     966
    936967    if (usingv4l2)
    937968    {
    938969        struct v4l2_control ctrl;
    939970        struct v4l2_queryctrl qctrl;
    940         memset(&ctrl, 0, sizeof(ctrl));
    941         memset(&qctrl, 0, sizeof(qctrl));
     971        bzero(&ctrl, sizeof(ctrl));
     972        bzero(&qctrl, sizeof(qctrl));
    942973
    943         if (field != -1)
     974        ctrl.id = qctrl.id = v4l2_attrib;
     975        if (ioctl(videofd, VIDIOC_QUERYCTRL, &qctrl) < 0)
    944976        {
    945             ctrl.id = qctrl.id = attrib;
    946             if (ioctl(videofd, VIDIOC_QUERYCTRL, &qctrl) < 0)
     977            VERBOSE(VB_IMPORTANT, loc_err + "failed to query controls." + ENO);
     978            return false;
     979        }
     980
     981        float new_range = qctrl.maximum - qctrl.minimum;
     982        float old_range = 65535 - 0;
     983        float scl_range = new_range / old_range;
     984        float dfl       = (qctrl.default_value - qctrl.minimum) / new_range;
     985        int   norm_dfl  = (0x10000 + (int)(dfl * old_range) - 32768) & 0xFFFF;
     986
     987        if (pict_attr_default.find(db_col_name) == pict_attr_default.end())
     988        {
     989            if (device_name == "pcHDTV HD3000 HDTV")
    947990            {
    948                 VERBOSE(VB_IMPORTANT,
    949                         QString("Channel(%1)::SetColourAttribute(): "
    950                                 "failed to query controls, error: %2").
    951                         arg(device).arg(strerror(errno)));
    952                 return;
     991                pict_attr_default["brightness"] = 9830;
     992                pict_attr_default["contrast"]   = 39322;
     993                pict_attr_default["colour"]     = 45875;
     994                pict_attr_default["hue"]        = 0;
    953995            }
    954             ctrl.value = (int)((qctrl.maximum - qctrl.minimum)
    955                                / 65535.0 * field + qctrl.minimum);
    956             ctrl.value = ctrl.value > qctrl.maximum
    957                               ? qctrl.maximum
    958                                   : ctrl.value < qctrl.minimum
    959                                        ? qctrl.minimum
    960                                             : ctrl.value;
    961             if (ioctl(videofd, VIDIOC_S_CTRL, &ctrl) < 0)
     996            else
    962997            {
    963                 VERBOSE(VB_IMPORTANT,
    964                         QString("Channel(%1)::SetColourAttribute(): "
    965                                 "failed to set controls, error: %2").
    966                         arg(device).arg(strerror(errno)));
    967                 return;
     998                pict_attr_default[db_col_name] = norm_dfl;
    968999            }
    9691000        }
    970     }
    971     else
    972     {
    973         unsigned short *setfield;
    974         struct video_picture vid_pic;
    975         memset(&vid_pic, 0, sizeof(vid_pic));
    9761001
    977         if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
     1002        int dfield = pict_attr_default[db_col_name];
     1003        field      = (cfield + sfield + dfield) & 0xFFFF;
     1004        int value0 = (int) ((scl_range * field) + qctrl.minimum);
     1005        int value1 = min(value0, (int)qctrl.maximum);
     1006        ctrl.value = max(value1, (int)qctrl.minimum);
     1007
     1008#if DEBUG_ATTRIB
     1009        VERBOSE(VB_CHANNEL, loc + QString("\n\t\t\t[%1,%2] dflt(%3, %4, %5)")
     1010                .arg(qctrl.minimum, 5).arg(qctrl.maximum, 5)
     1011                .arg(qctrl.default_value, 5).arg(dfl, 4, 'f', 2)
     1012                .arg(norm_dfl));
     1013#endif
     1014
     1015        if (ioctl(videofd, VIDIOC_S_CTRL, &ctrl) < 0)
    9781016        {
    979             VERBOSE(VB_IMPORTANT,
    980                     QString("Channel(%1)::SetColourAttribute(): failed "
    981                             "to get picture controls, error: %2").
    982                     arg(device).arg(strerror(errno)));
    983             return;
     1017            VERBOSE(VB_IMPORTANT, loc_err + "failed to set controls" + ENO);
     1018            return false;
    9841019        }
    985         setfield = GetV4L1Field(attrib, vid_pic);
    986         if (field != -1 && setfield)
    987         {
    988             *setfield = field;
    989             if (ioctl(videofd, VIDIOCSPICT, &vid_pic) < 0)
    990             {
    991                 VERBOSE(VB_IMPORTANT,
    992                         QString("Channel(%1)::SetColourAttribute(): failed "
    993                                 "to set picture controls, error: %2").
    994                         arg(device).arg(strerror(errno)));
    995                 return;
    996             }
    997         }
     1020
     1021        return true;
    9981022    }
    999     return;
     1023
     1024    // V4L1
     1025    unsigned short *setfield;
     1026    struct video_picture vid_pic;
     1027    bzero(&vid_pic, sizeof(vid_pic));
     1028
     1029    if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
     1030    {
     1031        VERBOSE(VB_IMPORTANT, loc_err + "failed to query controls." + ENO);
     1032        return false;
     1033    }
     1034    setfield = get_v4l1_field(v4l2_attrib, vid_pic);
     1035
     1036    if (!setfield)
     1037        return false;
     1038
     1039    *setfield = field;
     1040    if (ioctl(videofd, VIDIOCSPICT, &vid_pic) < 0)
     1041    {
     1042        VERBOSE(VB_IMPORTANT, loc_err + "failed to set controls." + ENO);
     1043        return false;
     1044    }
     1045
     1046    return true;
    10001047}
    10011048
    1002 void Channel::SetContrast(void)
     1049bool Channel::InitPictureAttributes(void)
    10031050{
    1004     SetColourAttribute(V4L2_CID_CONTRAST, "contrast");
    1005     return;
     1051    return (InitPictureAttribute("brightness") &&
     1052            InitPictureAttribute("contrast")   &&
     1053            InitPictureAttribute("colour")     &&
     1054            InitPictureAttribute("hue"));
    10061055}
    10071056
    1008 void Channel::SetBrightness()
     1057int Channel::GetPictureAttribute(const QString db_col_name) const
    10091058{
    1010     SetColourAttribute(V4L2_CID_BRIGHTNESS, "brightness");
    1011     return;
    1012 }
     1059    int cfield = ChannelUtil::GetChannelValueInt(
     1060        db_col_name, GetCurrentSourceID(), curchannelname);
     1061    int sfield = CardUtil::GetValueInt(
     1062        db_col_name, GetCardID(), GetCurrentSourceID());
     1063    int dfield = 0;
    10131064
    1014 void Channel::SetColour()
    1015 {
    1016     SetColourAttribute(V4L2_CID_SATURATION, "colour");
    1017     return;
     1065    if (pict_attr_default.find(db_col_name) != pict_attr_default.end())
     1066        dfield = pict_attr_default[db_col_name];
     1067
     1068    int val = (cfield + sfield + dfield) & 0xFFFF;
     1069
     1070#if DEBUG_ATTRIB
     1071    VERBOSE(VB_CHANNEL, QString(
     1072                "GetPictureAttribute(%1) -> cdb %2 rdb %3 d %4 -> %5")
     1073            .arg(db_col_name).arg(cfield).arg(sfield)
     1074            .arg(dfield).arg(val));
     1075#endif
     1076
     1077    return val;
    10181078}
    10191079
    1020 void Channel::SetHue(void)
     1080static int get_v4l2_attribute_value(int videofd, int v4l2_attrib)
    10211081{
    1022     SetColourAttribute(V4L2_CID_HUE, "hue");
    1023     return;
    1024 }
     1082    struct v4l2_control ctrl;
     1083    struct v4l2_queryctrl qctrl;
     1084    bzero(&ctrl, sizeof(ctrl));
     1085    bzero(&qctrl, sizeof(qctrl));
    10251086
    1026 int Channel::ChangeColourAttribute(int attrib, const char *name, bool up)
    1027 {
    1028     if (!pParent || is_dtv)
     1087    ctrl.id = qctrl.id = v4l2_attrib;
     1088    if (ioctl(videofd, VIDIOC_QUERYCTRL, &qctrl) < 0)
     1089    {
     1090        VERBOSE(VB_IMPORTANT, "get_v4l2_attribute_value: "
     1091                "failed to query controls (1)" + ENO);
    10291092        return -1;
     1093    }
    10301094
    1031     int newvalue;    // The int should have ample space to avoid overflow
    1032                      // in the case that we're just over or under 65535
     1095    if (ioctl(videofd, VIDIOC_G_CTRL, &ctrl) < 0)
     1096    {
     1097        VERBOSE(VB_IMPORTANT, "get_v4l2_attribute_value: "
     1098                "failed to get controls (2)" + ENO);
     1099        return -1;
     1100    }
    10331101
    1034     QString channel_field = name;
    1035     int current_value = ChannelUtil::GetChannelValueInt(
    1036         channel_field, GetCurrentSourceID(), curchannelname);
     1102    return (int)(65535.0 / (qctrl.maximum - qctrl.minimum) * ctrl.value);
     1103}
    10371104
    1038     int card_value;
     1105static int get_v4l1_attribute_value(int videofd, int v4l2_attrib)
     1106{
     1107    struct video_picture vid_pic;
     1108    bzero(&vid_pic, sizeof(vid_pic));
    10391109
    1040     if (usingv4l2)
     1110    if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
    10411111    {
    1042         struct v4l2_control ctrl;
    1043         struct v4l2_queryctrl qctrl;
    1044         memset(&ctrl, 0, sizeof(ctrl));
    1045         memset(&qctrl, 0, sizeof(qctrl));
     1112        VERBOSE(VB_IMPORTANT, "get_v4l1_attribute_value: "
     1113                "failed to get picture control (1)" + ENO);
     1114        return -1;
     1115    }
    10461116
    1047         ctrl.id = qctrl.id = attrib;
    1048         if (ioctl(videofd, VIDIOC_QUERYCTRL, &qctrl) < 0)
    1049         {
    1050             VERBOSE(VB_IMPORTANT,
    1051                     QString("Channel(%1)::ChangeColourAttribute(): "
    1052                             "failed to query controls (1), error: %2").
    1053                     arg(device).arg(strerror(errno)));
    1054             return -1;
    1055         }
     1117    unsigned short *setfield = get_v4l1_field(v4l2_attrib, vid_pic);
     1118    if (setfield)
     1119        return *setfield;
    10561120
    1057         if (ioctl(videofd, VIDIOC_G_CTRL, &ctrl) < 0)
    1058         {
    1059             VERBOSE(VB_IMPORTANT,
    1060                     QString("Channel(%1)::ChangeColourAttribute(): "
    1061                             "failed to get control, error: %2").
    1062                     arg(device).arg(strerror(errno)));
    1063             return -1;
    1064         }
    1065         card_value = (int)(65535.0 / (qctrl.maximum - qctrl.minimum) *
    1066                            ctrl.value);
    1067     }
    1068     else
    1069     {
    1070         unsigned short *setfield;
    1071         struct video_picture vid_pic;
    1072         memset(&vid_pic, 0, sizeof(vid_pic));
     1121    return -1;
     1122}
    10731123
    1074         if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
    1075         {
    1076             VERBOSE(VB_IMPORTANT,
    1077                     QString("Channel(%1)::ChangeColourAttribute(): "
    1078                             "failed to get picture control (1), error: %2").
    1079                     arg(device).arg(strerror(errno)));
    1080             return -1;
    1081         }
     1124static int get_attribute_value(bool usingv4l2, int videofd, int v4l2_attrib)
     1125{
     1126    if (usingv4l2)
     1127        return get_v4l2_attribute_value(videofd, v4l2_attrib);
     1128    return get_v4l1_attribute_value(videofd, v4l2_attrib);
     1129}
    10821130
    1083         setfield = GetV4L1Field(attrib, vid_pic);
    1084         if (!setfield)
    1085         {
    1086             return -1;
    1087         }
     1131static int set_v4l2_attribute_value(int videofd, int v4l2_attrib, int newvalue)
     1132{
     1133    struct v4l2_control ctrl;
     1134    struct v4l2_queryctrl qctrl;
     1135    bzero(&ctrl, sizeof(ctrl));
     1136    bzero(&qctrl, sizeof(qctrl));
    10881137
    1089         card_value = *setfield;
     1138    ctrl.id = qctrl.id = v4l2_attrib;
     1139    if (ioctl(videofd, VIDIOC_QUERYCTRL, &qctrl) < 0)
     1140    {
     1141        VERBOSE(VB_IMPORTANT, "set_v4l2_attribute_value: "
     1142                "failed to query control" + ENO);
     1143        return -1;
    10901144    }
    10911145
    1092     newvalue  = (current_value < 0) ? card_value : current_value;
    1093     newvalue += (up) ? 655 : -655;
     1146    float mult = (qctrl.maximum - qctrl.minimum) / 65535.0;
     1147    ctrl.value = (int)(mult * newvalue + qctrl.minimum);
     1148    ctrl.value = min(ctrl.value, qctrl.maximum);
     1149    ctrl.value = max(ctrl.value, qctrl.minimum);
    10941150
    1095     if (V4L2_CID_HUE == attrib)
     1151    if (ioctl(videofd, VIDIOC_S_CTRL, &ctrl) < 0)
    10961152    {
    1097         // wrap around for hue
    1098         newvalue = (newvalue > 65535) ? newvalue - 65535 : newvalue;
    1099         newvalue = (newvalue < 0)     ? newvalue + 65535 : newvalue;
     1153        VERBOSE(VB_IMPORTANT, "set_v4l2_attribute_value: "
     1154                "failed to set control" + ENO);
     1155        return -1;
    11001156    }
    11011157
    1102     // make sure we are within bounds
    1103     newvalue  = min(newvalue, 65535);
    1104     newvalue  = max(newvalue, 0);
     1158    return 0;
     1159}
    11051160
    1106     if (current_value >= 0)
     1161static int set_v4l1_attribute_value(int videofd, int v4l2_attrib, int newvalue)
     1162{
     1163    unsigned short *setfield;
     1164    struct video_picture vid_pic;
     1165    bzero(&vid_pic, sizeof(vid_pic));
     1166
     1167    if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
    11071168    {
    1108         // tell the DB about the new attributes
    1109         ChannelUtil::SetChannelValue(channel_field, QString::number(newvalue),
    1110                                      GetCurrentSourceID(), curchannelname);
     1169        VERBOSE(VB_IMPORTANT, "set_v4l1_attribute_value: "
     1170                "failed to get picture control." + ENO);
     1171        return -1;
    11111172    }
    1112 
    1113     if (usingv4l2)
     1173    setfield = get_v4l1_field(v4l2_attrib, vid_pic);
     1174    if (newvalue != -1 && setfield)
    11141175    {
    1115         struct v4l2_control ctrl;
    1116         struct v4l2_queryctrl qctrl;
    1117         memset(&ctrl, 0, sizeof(ctrl));
    1118         memset(&qctrl, 0, sizeof(qctrl));
    1119 
    1120         ctrl.id = qctrl.id = attrib;
    1121         if (ioctl(videofd, VIDIOC_QUERYCTRL, &qctrl) < 0)
     1176        *setfield = newvalue;
     1177        if (ioctl(videofd, VIDIOCSPICT, &vid_pic) < 0)
    11221178        {
    1123             VERBOSE(VB_IMPORTANT,
    1124                     QString("Channel(%1)::ChangeColourAttribute(): "
    1125                             "failed to query controls (2), error: %2").
    1126                     arg(device).arg(strerror(errno)));
     1179            VERBOSE(VB_IMPORTANT, "set_v4l1_attribute_value: "
     1180                    "failed to set picture control." + ENO);
    11271181            return -1;
    11281182        }
    1129         float mult = (qctrl.maximum - qctrl.minimum) / 65535.0;
    1130         ctrl.value = (int)(mult * newvalue + qctrl.minimum);
    1131         ctrl.value = min(ctrl.value, qctrl.maximum);
    1132         ctrl.value = max(ctrl.value, qctrl.minimum);
    1133 
    1134         if (ioctl(videofd, VIDIOC_S_CTRL, &ctrl) < 0)
    1135         {
    1136             VERBOSE(VB_IMPORTANT,
    1137                     QString("Channel(%1)::ChangeColourAttribute(): "
    1138                             "failed to set control, error: %2").
    1139                     arg(device).arg(strerror(errno)));
    1140             return -1;
    1141         }
    11421183    }
    11431184    else
    11441185    {
    1145         unsigned short *setfield;
    1146         struct video_picture vid_pic;
    1147         memset(&vid_pic, 0, sizeof(vid_pic));
    1148 
    1149         if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
    1150         {
    1151             VERBOSE(VB_IMPORTANT,
    1152                     QString("Channel(%1)::ChangeColourAttribute(): "
    1153                             "failed to get picture control (2), error: %2").
    1154                     arg(device).arg(strerror(errno)));
    1155             return -1;
    1156         }
    1157         setfield = GetV4L1Field(attrib, vid_pic);
    1158         if (newvalue != -1 && setfield)
    1159         {
    1160             *setfield = newvalue;
    1161             if (ioctl(videofd, VIDIOCSPICT, &vid_pic) < 0)
    1162             {
    1163                 VERBOSE(VB_IMPORTANT,
    1164                         QString("Channel(%1)::ChangeColourAttribute(): "
    1165                                 "failed to set picture control, error: %2").
    1166                         arg(device).arg(strerror(errno)));
    1167                 return -1;
    1168             }
    1169         }
    1170         else
    1171         {
    1172             // ???
    1173             return -1;
    1174         }
     1186        // ???
     1187        return -1;
    11751188    }
    11761189
    1177     return newvalue / 655;
     1190    return 0;
    11781191}
    11791192
    1180 int Channel::ChangeContrast(bool up)
     1193static int set_attribute_value(bool usingv4l2, int videofd,
     1194                               int v4l2_attrib, int newvalue)
    11811195{
    1182     return ChangeColourAttribute(V4L2_CID_CONTRAST, "contrast", up);
     1196    if (usingv4l2)
     1197        return set_v4l2_attribute_value(videofd, v4l2_attrib, newvalue);
     1198    return set_v4l1_attribute_value(videofd, v4l2_attrib, newvalue);
    11831199}
    11841200
    1185 int Channel::ChangeBrightness(bool up)
     1201int Channel::ChangePictureAttribute(
     1202    int type, const QString db_col_name, bool up)
    11861203{
    1187     return ChangeColourAttribute(V4L2_CID_BRIGHTNESS, "brightness", up);
    1188 }
     1204    if (!pParent || is_dtv)
     1205        return -1;
    11891206
    1190 int Channel::ChangeColour(bool up)
    1191 {
    1192     return ChangeColourAttribute(V4L2_CID_SATURATION, "colour", up);
    1193 }
     1207    int v4l2_attrib = get_v4l2_attribute(db_col_name);
     1208    if (v4l2_attrib == -1)
     1209        return -1;
    11941210
    1195 int Channel::ChangeHue(bool up)
    1196 {
    1197     return ChangeColourAttribute(V4L2_CID_HUE, "hue", up);
     1211    // get the old attribute value from the hardware, this is
     1212    // just a sanity check on whether this attribute exists
     1213    if (get_attribute_value(usingv4l2, videofd, v4l2_attrib) < 0)
     1214        return -1;
     1215
     1216    int old_value = GetPictureAttribute(db_col_name);
     1217    int new_value = old_value + ((up) ? 655 : -655);
     1218
     1219    // make sure we are within bounds (wrap around for hue)
     1220    if (V4L2_CID_HUE == v4l2_attrib)
     1221        new_value &= 0xffff;
     1222    new_value = min(max(new_value, 0), 65535);
     1223
     1224#if DEBUG_ATTRIB
     1225    VERBOSE(VB_CHANNEL, QString(
     1226                "ChangePictureAttribute(%1,%2,%3) cur %4 -> new %5")
     1227            .arg(type).arg(db_col_name).arg(up)
     1228            .arg(old_value).arg(new_value));
     1229#endif
     1230
     1231    // actually set the new attribute value on the hardware
     1232    if (set_attribute_value(usingv4l2, videofd, v4l2_attrib, new_value) < 0)
     1233        return -1;
     1234
     1235    // tell the DB about the new attribute value
     1236    if (kAdjustingPicture_Channel == type)
     1237    {
     1238        int adj_value = ChannelUtil::GetChannelValueInt(
     1239            db_col_name, GetCurrentSourceID(), curchannelname);
     1240
     1241        int tmp = new_value - old_value + adj_value;
     1242        tmp = (tmp < 0)      ? tmp + 0x10000 : tmp;
     1243        tmp = (tmp > 0xffff) ? tmp - 0x10000 : tmp;
     1244        ChannelUtil::SetChannelValue(db_col_name, QString::number(tmp),
     1245                                     GetCurrentSourceID(), curchannelname);
     1246    }
     1247    else if (kAdjustingPicture_Recording == type)
     1248    {
     1249        int adj_value = CardUtil::GetValueInt(
     1250            db_col_name, GetCardID(), GetCurrentSourceID());
     1251
     1252        int tmp = new_value - old_value + adj_value;
     1253        tmp = (tmp < 0)      ? tmp + 0x10000 : tmp;
     1254        tmp = (tmp > 0xffff) ? tmp - 0x10000 : tmp;
     1255        CardUtil::SetValue(db_col_name, GetCardID(),
     1256                           GetCurrentSourceID(), tmp);
     1257    }
     1258
     1259    return new_value;
    11981260}
    1199 
  • mythtv/libs/libmyth/mythcontext.h

     
    229229 *   You must also update this value in
    230230 *   mythplugins/mythweb/includes/mythbackend.php
    231231 */
    232 #define MYTH_PROTO_VERSION "29"
     232#define MYTH_PROTO_VERSION "30"
    233233
    234234/** \class MythContext
    235235 *  \brief This class contains the runtime context for MythTV.
  • mythtv/programs/mythbackend/encoderlink.h

     
    8484    void ToggleChannelFavorite(void);
    8585    void ChangeChannel(int channeldirection);
    8686    void SetChannel(const QString &name);
    87     int ChangeContrast(bool direction);
    88     int ChangeBrightness(bool direction);
    89     int ChangeColour(bool direction);
    90     int ChangeHue(bool direction);
     87    int  GetPictureAttribute(PictureAttribute attr);
     88    int  ChangePictureAttribute(PictureAdjustType type,
     89                                PictureAttribute  attr,
     90                                bool              direction);
    9191    bool CheckChannel(const QString &name);
    9292    bool ShouldSwitchToAnotherCard(const QString &channelid);
    9393    bool CheckChannelPrefix(const QString&,uint&,bool&,QString&);
  • mythtv/programs/mythbackend/mainserver.cpp

     
    25632563        int oldrate = enc->SetSignalMonitoringRate(rate, notifyFrontend);
    25642564        retlist << QString::number(oldrate);
    25652565    }
     2566    else if (command == "GET_COLOUR")
     2567    {
     2568        int ret = enc->GetPictureAttribute(kPictureAttribute_Colour);
     2569        retlist << QString::number(ret);
     2570    }
     2571    else if (command == "GET_CONTRAST")
     2572    {
     2573        int ret = enc->GetPictureAttribute(kPictureAttribute_Contrast);
     2574        retlist << QString::number(ret);
     2575    }
     2576    else if (command == "GET_BRIGHTNESS")
     2577    {
     2578        int ret = enc->GetPictureAttribute(kPictureAttribute_Brightness);
     2579        retlist << QString::number(ret);
     2580    }
     2581    else if (command == "GET_HUE")
     2582    {
     2583        int ret = enc->GetPictureAttribute(kPictureAttribute_Hue);
     2584        retlist << QString::number(ret);
     2585    }
    25662586    else if (command == "CHANGE_COLOUR")
    25672587    {
    2568         bool up = slist[2].toInt();
    2569         retlist << QString::number(enc->ChangeColour(up));
     2588        int  type = slist[2].toInt();
     2589        bool up   = slist[3].toInt();
     2590        int  ret = enc->ChangePictureAttribute(
     2591            (PictureAdjustType) type, kPictureAttribute_Colour, up);
     2592        retlist << QString::number(ret);
    25702593    }
    25712594    else if (command == "CHANGE_CONTRAST")
    25722595    {
    2573         bool up = slist[2].toInt();
    2574         retlist << QString::number(enc->ChangeContrast(up));
     2596        int  type = slist[2].toInt();
     2597        bool up   = slist[3].toInt();
     2598        int  ret = enc->ChangePictureAttribute(
     2599            (PictureAdjustType) type, kPictureAttribute_Contrast, up);
     2600        retlist << QString::number(ret);
    25752601    }
    25762602    else if (command == "CHANGE_BRIGHTNESS")
    25772603    {
    2578         bool up = slist[2].toInt();
    2579         retlist << QString::number(enc->ChangeBrightness(up));
     2604        int  type= slist[2].toInt();
     2605        bool up  = slist[3].toInt();
     2606        int  ret = enc->ChangePictureAttribute(
     2607            (PictureAdjustType) type, kPictureAttribute_Brightness, up);
     2608        retlist << QString::number(ret);
    25802609    }
    25812610    else if (command == "CHANGE_HUE")
    25822611    {
    2583         bool up = slist[2].toInt();
    2584         retlist << QString::number(enc->ChangeHue(up));
     2612        int  type= slist[2].toInt();
     2613        bool up  = slist[3].toInt();
     2614        int  ret = enc->ChangePictureAttribute(
     2615            (PictureAdjustType) type, kPictureAttribute_Hue, up);
     2616        retlist << QString::number(ret);
    25852617    }
    25862618    else if (command == "CHECK_CHANNEL")
    25872619    {
  • mythtv/programs/mythbackend/encoderlink.cpp

     
    750750        VERBOSE(VB_IMPORTANT, "Should be local only query: SetChannel");
    751751}
    752752
    753 /** \fn EncoderLink::ChangeContrast(bool)
    754  *  \brief Changes contrast of a recording.
     753/** \fn EncoderLink::GetPictureAttribute(PictureAttribute)
     754 *  \brief Changes brightness/contrast/colour/hue of a recording.
    755755 *         <b>This only works on local recorders.</b>
    756756 *
    757757 *  Note: In practice this only works with frame grabbing recorders.
    758758 *
    759  *  \return contrast if it succeeds, -1 otherwise.
     759 *  \return current value if it succeeds, -1 otherwise.
    760760 */
    761 int EncoderLink::ChangeContrast(bool direction)
     761int EncoderLink::GetPictureAttribute(PictureAttribute attr)
    762762{
    763     int ret = -1;
     763    if (!local)
     764    {
     765        VERBOSE(VB_IMPORTANT, "Should be local only query: "
     766                "GetPictureAttribute");
     767        return -1;
     768    }
    764769
    765     if (local)
    766         ret = tv->ChangeContrast(direction);
    767     else
    768         VERBOSE(VB_IMPORTANT, "Should be local only query: ChangeContrast");
    769 
    770     return ret;
     770    return tv->GetPictureAttribute(attr);
    771771}
    772772
    773 /** \fn EncoderLink::ChangeBrightness(bool)
    774  *  \brief Changes the brightness of a recording.
     773/** \fn EncoderLink::ChangePictureAttribute(PictureAdjustType,PictureAttribute,bool)
     774 *  \brief Changes brightness/contrast/colour/hue of a recording.
    775775 *         <b>This only works on local recorders.</b>
    776776 *
    777777 *  Note: In practice this only works with frame grabbing recorders.
    778778 *
    779  *  \return brightness if it succeeds, -1 otherwise.
     779 *  \return current value if it succeeds, -1 otherwise.
    780780 */
    781 int EncoderLink::ChangeBrightness(bool direction)
     781int EncoderLink::ChangePictureAttribute(PictureAdjustType type,
     782                                        PictureAttribute  attr,
     783                                        bool              direction)
    782784{
    783     int ret = -1;
     785    if (!local)
     786    {
     787        VERBOSE(VB_IMPORTANT, "Should be local only query: "
     788                "ChangePictureAttribute");
     789        return -1;
     790    }
    784791
    785     if (local)
    786         ret = tv->ChangeBrightness(direction);
    787     else
    788         VERBOSE(VB_IMPORTANT, "Should be local only query: ChangeBrightness");
    789 
    790     return ret;
     792    return tv->ChangePictureAttribute(type, attr, direction);
    791793}
    792794
    793 /** \fn EncoderLink::ChangeColour(bool)
    794  *  \brief Changes the colour phase of a recording.
    795  *         <b>This only works on local recorders.</b>
    796  *
    797  *  Note: In practice this only works with frame grabbing recorders.
    798  *
    799  *  \return colour if it succeeds, -1 otherwise.
    800  */
    801 int EncoderLink::ChangeColour(bool direction)
    802 {
    803     int ret = -1;
    804 
    805     if (local)
    806         ret = tv->ChangeColour(direction);
    807     else
    808         VERBOSE(VB_IMPORTANT, "Should be local only query: ChangeColor");
    809 
    810     return ret;
    811 }
    812 
    813 /** \fn EncoderLink::ChangeHue(bool)
    814  *  \brief Changes the hue of a recording.
    815  *         <b>This only works on local recorders.</b>
    816  *
    817  *  Note: In practice this only works with frame grabbing recorders.
    818  *
    819  *  \return hue if it succeeds, -1 otherwise.
    820  */
    821 int EncoderLink::ChangeHue(bool direction)
    822 {
    823     int ret = -1;
    824 
    825     if (local)
    826         ret = tv->ChangeHue(direction);
    827     else
    828         VERBOSE(VB_IMPORTANT, "Should be local only query: ChangeHue");
    829 
    830     return ret;
    831 }
    832 
    833795/** \fn EncoderLink::CheckChannel(const QString&)
    834796 *  \brief Checks if named channel exists on current tuner.
    835797 *         <b>This only works on local recorders.</b>