Skip to content

Commit

Permalink
webapp setup: Add support for SATIP cards
Browse files Browse the repository at this point in the history
  • Loading branch information
bennettpeter committed Apr 3, 2023
1 parent f982266 commit 5b48437
Show file tree
Hide file tree
Showing 12 changed files with 356 additions and 13 deletions.
17 changes: 16 additions & 1 deletion mythtv/html/assets/i18n/en_US.json
Expand Up @@ -521,7 +521,22 @@
"title": "HD-PVR H.264 Encoder",
"audiodevice_label": "Audio Input",
"audiodevice_desc": "If there is more than one audio input, select which one to use."
}
},
"satip": {
"title": "Sat>IP Networked Tuner",
"device_label": "Available Devices",
"device_desc": "Device IP or ID, tuner number and tuner type of available Sat>IP device.",
"friendly_label": "Friendly Name",
"tunertype_label": "Tuner Type",
"tunerindex_label": "Tuner Index",
"deviceid_label": "Device ID",
"diseqcpos_label": "DiSEqC position",
"diseqcpos_desc": "Position of the LNB on the DiSEqC switch. Leave at 1 if there is no DiSEqC switch and the LNB is directly connected to the SatIP server. This value is used as signal source (attribute src) in the SatIP tune command."
},
"friendly_desc": "Friendly name of the Sat>IP server",
"tunertype_desc": "Type of the selected tuner",
"tunerindex_desc": "Index of the tuner on the Sat>IP server",
"deviceid_desc": "Device ID of the Sat>IP tuner."
},
"common": {
"successful_delete": "Successful delete",
Expand Down
2 changes: 2 additions & 0 deletions mythtv/html/backend/src/app/app.module.ts
Expand Up @@ -72,6 +72,7 @@ import { SystemEventsComponent } from './config/settings/system-events/system-ev
import { BackendWarningComponent } from './config/backend-warning/backend-warning.component';
import { V4l2Component } from './config/settings/capture-cards/v4l2/v4l2.component';
import { HdpvrComponent } from './config/settings/capture-cards/hdpvr/hdpvr.component';
import { SatipComponent } from './config/settings/capture-cards/satip/satip.component';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
Expand Down Expand Up @@ -140,6 +141,7 @@ export function HttpLoaderFactory(http: HttpClient) {
BackendWarningComponent,
V4l2Component,
HdpvrComponent,
SatipComponent,
],
imports: [
BrowserModule,
Expand Down
Expand Up @@ -116,6 +116,8 @@ <h2>{{ 'settings.common.ru_sure' | translate }}</h2>
</app-v4l2>
<app-hdpvr *ngSwitchCase="'HDPVR'" [card]="m_CaptureCardsFiltered[ix]" [cardList]="m_CaptureCardList">
</app-hdpvr>
<app-satip *ngSwitchCase="'SATIP'" [card]="m_CaptureCardsFiltered[ix]" [cardList]="m_CaptureCardList">
</app-satip>
<div *ngSwitchDefault><br>Not Supported </div>
</div>
</ng-template>
Expand Down
Expand Up @@ -28,7 +28,8 @@ export class CaptureCardsComponent implements OnInit, CanComponentDeactivate {
'IMPORT',
'DEMO',
'V4L2ENC',
'HDPVR'
'HDPVR',
'SATIP'
];

currentTab: number = -1;
Expand Down Expand Up @@ -177,23 +178,15 @@ export class CaptureCardsComponent implements OnInit, CanComponentDeactivate {
};
// Update non-standard defaults on some card types.
switch (newOne.CardType) {
case "DVB":
newOne.SignalTimeout = 500;
break;
case "HDHOMERUN":
newOne.SignalTimeout = 3000;
newOne.ChannelTimeout = 6000;
break;
case "EXTERNAL":
newOne.ChannelTimeout = 20000;
break;
case "FREEBOX":
newOne.VideoDevice = "http://mafreebox.freebox.fr/freeboxtv/playlist.m3u"
newOne.ChannelTimeout = 30000;
break;
case "HDPVR":
newOne.ChannelTimeout = 15000;
break;
case "SATIP":
newOne.DVBDiSEqCType = 1;
}
for (let i = 0; i < this.activeTab.length; i++)
this.activeTab[i] = false;
Expand Down
Expand Up @@ -235,7 +235,7 @@ export class DvbComponent implements OnInit, AfterViewInit {
this.card.VideoDevice = this.currentDevice.VideoDevice;
this.card.InputName = this.currentDevice.DefaultInputName;
this.card.SignalTimeout = this.currentDevice.SignalTimeout;
this.card.SignalTimeout = this.currentDevice.SignalTimeout;
this.card.ChannelTimeout = this.currentDevice.ChannelTimeout;
this.checkInUse();
}

Expand Down
Expand Up @@ -78,6 +78,8 @@ export class HdhomerunComponent implements OnInit, AfterViewInit {
this.selectedDevices.forEach(
x => {
videoDevices.push(x.VideoDevice.split(' ')[0]);
this.card.SignalTimeout = x.SignalTimeout;
this.card.ChannelTimeout = x.ChannelTimeout;
}
)
videoDevices.sort();
Expand Down
Expand Up @@ -100,6 +100,7 @@ export class HdpvrComponent implements OnInit {
this.card.VideoDevice = this.currentDevice.VideoDevice;
this.card.InputName = this.currentDevice.DefaultInputName;
this.card.AudioDevice = "";
this.card.ChannelTimeout = this.currentDevice.ChannelTimeout;
this.checkInUse();
}

Expand Down
Empty file.
@@ -0,0 +1,135 @@
<form class="ml-3 mr-3" name="satipform" #satipform="ngForm">
<span #top></span>
<p-card class="m-5">
<ng-template pTemplate="title">
{{ 'settings.capture.satip.title' | translate }}
</ng-template>
<ng-template pTemplate="subtitle">
</ng-template>
<ng-template pTemplate="content">
<div class="grid">
<div class="mb-4 w-full">

<div class="form-group field">
<label for="VideoDevice" class="block">{{ 'settings.capture.satip.device_label' | translate
}}</label>
<p-dropdown *ngIf="isReady" [options]="captureDeviceList.CaptureDeviceList.CaptureDevices"
[(ngModel)]="currentDevice" [editable]="false" optionLabel="VideoDevicePrompt"
(onChange)="updateDevice();" [maxlength]="0" [style]="{'minWidth':'83%'}" name="VideoDevice"
#VideoDevice="ngModel">
</p-dropdown>
<div *ngIf="warningMessage">
<small class="p-error block">
{{ warningMessage }}
</small>
</div>
<small class="block">
{{ 'settings.capture.satip.device_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label class="block">{{ 'settings.capture.satip.friendly_label' | translate
}}</label>
<div class="col-10 bg-blue-100">
{{ currentDevice.FriendlyName}} &nbsp;
</div>
<small class="block">
{{ 'settings.capture.friendly_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label class="block">{{ 'settings.capture.satip.tunertype_label' | translate
}}</label>
<div class="col-10 bg-blue-100">
{{ currentDevice.TunerType}} &nbsp;
</div>
<small class="block">
{{ 'settings.capture.tunertype_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label class="block">{{ 'settings.capture.satip.tunerindex_label' | translate
}}</label>
<div class="col-10 bg-blue-100">
{{ currentDevice.TunerNumber}} &nbsp;
</div>
<small class="block">
{{ 'settings.capture.tunerindex_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label class="block">{{ 'settings.capture.satip.deviceid_label' | translate
}}</label>
<div class="col-10 bg-blue-100">
{{ card.VideoDevice}} &nbsp;
</div>
<small class="block">
{{ 'settings.capture.deviceid_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label for="SignalTimeout" class="block">{{ 'settings.capture.sigtimeout_label' | translate
}}</label>
<p-inputNumber [(ngModel)]="card.SignalTimeout" name="SignalTimeout" id="SignalTimeout"
[showButtons]="true" [min]="250" [max]="60000" [step]="250"></p-inputNumber>
<small class="block">
{{ 'settings.capture.sigtimeout_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label for="ChannelTimeout" class="block">{{ 'settings.capture.tunetimeout_label' | translate
}}</label>
<p-inputNumber [(ngModel)]="card.ChannelTimeout" name="ChannelTimeout" id="ChannelTimeout"
[showButtons]="true" [min]="2000" [max]="65000" [step]="250"></p-inputNumber>
<small class="block">
{{ 'settings.capture.tunetimeout_desc' | translate }}
</small>
</div>

<div class="form-group field">
<p-checkbox inputId="DVBEITScan" [(ngModel)]="card.DVBEITScan" name="DVBEITScan"
#DVBEITScan="ngModel" class="mb-2 w-full" [binary]="true"
label="{{ 'settings.capture.dvb.eitscan_label' | translate }}">
</p-checkbox>
<small class="block">
{{ 'settings.capture.dvb.eitscan_desc' | translate }}
</small>
</div>

<div class="form-group field">
<label for="DVBDiSEqCType" class="block">{{ 'settings.capture.satip.diseqcpos_label' | translate
}}</label>
<p-inputNumber [(ngModel)]="card.DVBDiSEqCType" name="DVBDiSEqCType" id="DVBDiSEqCType"
[showButtons]="true" [min]="1" [max]="255" [step]="1"></p-inputNumber>
<small class="block">
{{ 'settings.capture.satip.diseqcpos_desc' | translate }}
</small>
</div>

</div>
</div>
</ng-template>

<ng-template pTemplate="footer">
<div class="grid nogutter">
<div class="col-12">
<p-message *ngIf="this.successCount > 0 && this.errorCount == 0 && !satipform.dirty"
severity="success" text="{{ 'common.savesuccess' | translate }}"></p-message>
<p-message *ngIf="this.errorCount > 0" severity="error"
text="{{ 'common.networkfail' | translate }}"></p-message>
</div>
<p-button class="col pr-1" label="{{'common.save' | translate}}" icon="pi pi-save" iconPos="left"
(onClick)="saveForm(); satipform.form.markAsPristine()"
[disabled]="!satipform.dirty || !card.VideoDevice || setupService.schedulingEnabled"></p-button>
</div>
</ng-template>


</p-card>
</form>
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SatipComponent } from './satip.component';

describe('SatipComponent', () => {
let component: SatipComponent;
let fixture: ComponentFixture<SatipComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SatipComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(SatipComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

0 comments on commit 5b48437

Please sign in to comment.