Ticket #3162: nz_mheg_support.patch
File nz_mheg_support.patch, 8.7 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
417 417 REG_KEY("ITV Menu", "MENUBLUE", "Menu Blue", "F5"); 418 418 REG_KEY("ITV Menu", "TEXTEXIT", "Menu Exit", "F6"); 419 419 REG_KEY("ITV Menu", "MENUTEXT", "Menu Text", "F7"); 420 REG_KEY("ITV Menu", "MENUEPG", "Menu EPG", "F12"); 420 421 /* 421 422 keys already used: 422 423 -
libs/libmythtv/mhi.h
101 101 void DrawImage(int x, int y, const QRect &rect, const QImage &image); 102 102 103 103 virtual int GetChannelIndex(const QString &str); 104 /// Get netId etc from the channel index. 105 virtual bool GetServiceInfo(int channelId, int &netId, int &origNetId, 106 int &transportId, int &serviceId); 104 107 virtual bool TuneTo(int channel); 105 108 106 109 /// Begin playing audio from the specified stream -
libs/libmythtv/mhi.cpp
327 327 int action = 0; 328 328 QMutexLocker locker(&m_keyLock); 329 329 330 // Guess that the NZ profile is similar to UK but with 331 // different codes for the colour keys. 332 330 333 if (key == "UP") 331 334 { 332 if (m_keyProfile == 4 || m_keyProfile == 5) 335 if (m_keyProfile == 4 || m_keyProfile == 5 || 336 m_keyProfile == 14 || m_keyProfile == 15) 333 337 action = 1; 334 338 } 335 339 else if (key == "DOWN") 336 340 { 337 if (m_keyProfile == 4 || m_keyProfile == 5) 341 if (m_keyProfile == 4 || m_keyProfile == 5 || 342 m_keyProfile == 14 || m_keyProfile == 15) 338 343 action = 2; 339 344 } 340 345 else if (key == "LEFT") 341 346 { 342 if (m_keyProfile == 4 || m_keyProfile == 5) 347 if (m_keyProfile == 4 || m_keyProfile == 5 || 348 m_keyProfile == 14 || m_keyProfile == 15) 343 349 action = 3; 344 350 } 345 351 else if (key == "RIGHT") 346 352 { 347 if (m_keyProfile == 4 || m_keyProfile == 5) 353 if (m_keyProfile == 4 || m_keyProfile == 5 || 354 m_keyProfile == 14 || m_keyProfile == 15) 348 355 action = 4; 349 356 } 350 357 else if (key == "0" || key == "1" || key == "2" || … … 352 359 key == "6" || key == "7" || key == "8" || 353 360 key == "9") 354 361 { 355 if (m_keyProfile == 4 )362 if (m_keyProfile == 4 || m_keyProfile == 14) 356 363 action = key.toInt() + 5; 357 364 } 358 365 else if (key == "SELECT") 359 366 { 360 if (m_keyProfile == 4 || m_keyProfile == 5) 367 if (m_keyProfile == 4 || m_keyProfile == 5 || 368 m_keyProfile == 14 || m_keyProfile == 15) 361 369 action = 15; 362 370 } 363 371 else if (key == "TEXTEXIT") … … 371 379 else if (key == "MENUBLUE") 372 380 action = 103; 373 381 else if (key == "MENUTEXT") 374 action = 104; 382 action = m_keyProfile > 12 ? 105 : 104; 383 else if (key == "MENUEPG") 384 action = m_keyProfile > 12 ? 300 : 0; 375 385 376 386 if (action != 0) 377 387 { … … 573 583 if (query.exec() && query.isActive() && query.next()) 574 584 return query.value(0).toInt(); 575 585 } 576 else if (str == "rec://svc/cur" )586 else if (str == "rec://svc/cur" || str == "rec://svc/def") 577 587 return m_currentChannel; 578 588 else if (str.startsWith("rec://")) 579 589 { … … 581 591 return -1; 582 592 } 583 593 594 // Get netId etc from the channel index. This is the inverse of GetChannelIndex. 595 bool MHIContext::GetServiceInfo(int channelId, int &netId, int &origNetId, 596 int &transportId, int &serviceId) 597 { 598 MSqlQuery query(MSqlQuery::InitCon()); 599 query.prepare("SELECT networkid, transportid, serviceid " 600 "FROM channel, dtv_multiplex " 601 "WHERE chanid = :CHANID AND " 602 " channel.mplexid = dtv_multiplex.mplexid"); 603 query.bindValue(":CHANID", channelId); 604 if (query.exec() && query.isActive() && query.next()) 605 { 606 netId = query.value(0).toInt(); 607 origNetId = netId; // We don't have this in the database. 608 transportId = query.value(1).toInt(); 609 serviceId = query.value(2).toInt(); 610 return true; 611 } 612 else return false; 613 } 614 584 615 bool MHIContext::TuneTo(int channel) 585 616 { 586 617 if (!m_isLive) -
libs/libmythfreemheg/freemheg.h
116 116 117 117 // Tuning. Get the index corresponding to a given channel. 118 118 virtual int GetChannelIndex(const QString &str) = 0; 119 // Get netId etc from the channel index. 120 virtual bool GetServiceInfo(int channelId, int &netId, int &origNetId, 121 int &transportId, int &serviceId) = 0; 119 122 // Tune to an index returned by GetChannelIndex 120 123 virtual bool TuneTo(int channel) = 0; 121 124 -
libs/libmythfreemheg/Programs.cpp
389 389 // Indicates whether to perform a subsequent TIn quietly or normally. 390 390 MHERROR("SI_TuneIndexInfo ResidentProgram is not implemented"); 391 391 } 392 392 393 else if (m_Name.Equal("BSI")) { // SI_GetBasicSI 393 394 // Returns basic SI information about the service indicated by an index 394 395 // returned by GSI. 395 396 // Returns networkID, origNetworkID, transportStreamID, serviceID 396 MHERROR("SI_GetBasicSI ResidentProgram is not implemented"); 397 if (args.Size() == 5) { 398 int channelId = GetInt(args.GetAt(0), engine); 399 int netId, origNetId, transportId, serviceId; 400 // Look the information up in the database. 401 bool res = engine->GetContext()->GetServiceInfo(channelId, netId, origNetId, 402 transportId, serviceId); 403 if (res) 404 { 405 engine->FindObject(*(args.GetAt(1)->GetReference()))->SetVariableValue(netId); 406 engine->FindObject(*(args.GetAt(2)->GetReference()))->SetVariableValue(origNetId); 407 engine->FindObject(*(args.GetAt(3)->GetReference()))->SetVariableValue(transportId); 408 engine->FindObject(*(args.GetAt(4)->GetReference()))->SetVariableValue(serviceId); 409 } 410 SetSuccessFlag(success, res, engine); 411 } 412 else SetSuccessFlag(success, false, engine); 397 413 } 414 398 415 else if (m_Name.Equal("GBI")) { // GetBootInfo 399 416 // Gets the NB_info field. 400 417 MHERROR("GetBootInfo ResidentProgram is not implemented"); 401 418 } 419 402 420 else if (m_Name.Equal("CCR")) { // CheckContentRef 403 421 // Sees if an item with a particular content reference is available 404 // in the carousel. 405 MHERROR("CheckContentRef ResidentProgram is not implemented"); 422 // in the carousel. This looks like it should block until the file 423 // is available. The profile recommends that this should be forked 424 // rather than called. 425 if (args.Size() == 3) { 426 MHUnion un; 427 un.GetValueFrom(*(args.GetAt(0)), engine); 428 un.CheckType(MHUnion::U_ContentRef); 429 MHContentRef fileName; 430 fileName.Copy(un.m_ContentRefVal); 431 QString csPath = engine->GetPathName(fileName.m_ContentRef); 432 bool result = false; 433 QByteArray text; 434 // Try to load the object. 435 if (! csPath.isEmpty()) 436 result = engine->GetContext()->GetCarouselData(csPath, text); 437 // Set the result variable. 438 MHParameter *pResFlag = args.GetAt(1); 439 engine->FindObject(*(pResFlag->GetReference()))->SetVariableValue(result); 440 MHParameter *pResCR = args.GetAt(2); 441 // Copy the file name to the resulting content ref. 442 engine->FindObject(*(pResCR->GetReference()))->SetVariableValue(fileName); 443 SetSuccessFlag(success, true, engine); 444 } 445 else SetSuccessFlag(success, false, engine); 406 446 } 447 407 448 else if (m_Name.Equal("CGR")) { // CheckGroupIDRef 408 449 // Sees if an application or scene with a particular group id 409 450 // is available in the carousel.