<form class="ml-3 mr-3" name="hdhomerunform" #hdhomerunform="ngForm">
    <span #top></span>
    <p-card class="m-5">
        <ng-template pTemplate="title">
            {{ 'settings.capture.hdhomerun.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="label block">{{ 'settings.capture.hdhomerun.device_label' | translate
                            }}</label>
                        <div [style]="{'width':'30rem'}">
                            <p-listbox *ngIf="work.isReady"
                                [options]="captureDeviceList.CaptureDeviceList.CaptureDevices"
                                [(ngModel)]="selectedDevices" optionLabel="VideoDevice" [checkbox]="true"
                                [showToggleAll]="false" [multiple]="true" (onChange)="updateDevices();"
                                name="VideoDevice" #VideoDevice="ngModel">
                            </p-listbox>
                            <small class="block">
                                {{ 'settings.capture.hdhomerun.device_desc' | translate }}
                            </small>
                        </div>
                    </div>
                    <div class="form-group field">
                        <label for="SignalTimeout" class="label 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="label block">{{ 'settings.capture.tunetimeout_label' | translate
                            }}</label>
                        <p-inputNumber [(ngModel)]="card.ChannelTimeout" name="ChannelTimeout" id="ChannelTimeout"
                            [showButtons]="true" [min]="1750" [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="label mb-2 w-full" [binary]="true"
                            label="{{ 'settings.capture.hdhomerun.eitscan_label' | translate }}">
                        </p-checkbox>
                        <small class="block">
                            {{ 'settings.capture.dvb.eitscan_ldesc' | translate }}
                        </small>
                    </div>

                </div>

            </div>
        </ng-template>

        <ng-template pTemplate="footer">
            <div class="grid nogutter">
                <div class="col-12">
                    <p-message *ngIf="this.work.successCount > 0 && this.work.errorCount == 0 && !hdhomerunform.dirty"
                        severity="success" text="{{ 'common.savesuccess' | translate }}"></p-message>
                    <p-message *ngIf="this.work.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(); hdhomerunform.form.markAsPristine()"
                    [disabled]="!hdhomerunform.dirty || !card.VideoDevice || setupService.schedulingEnabled"></p-button>
            </div>
        </ng-template>
    </p-card>
</form>