Skip to content

Commit

Permalink
Add waveform configuration in project form
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Sep 20, 2023
1 parent 43adb59 commit 316a31e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,21 @@ public class Project extends BaseIndexedBean implements Comparable<Project> {
private Folder preview;

/**
* Folder with media to use for the video preview.
* Folder with media to use for the audio preview.
*/
@ManyToOne
@JoinColumn(name = "preview_audio_folder_id", foreignKey = @ForeignKey(name = "FK_project_preview_audio_folder_id"))
private Folder audioPreview;

/**
* Folder with media to use for the video viewer.
* Folder with media to use for the audio viewer.
*/
@ManyToOne
@JoinColumn(name = "mediaView_audio_folder_id", foreignKey = @ForeignKey(name = "FK_project_mediaView_audio_folder_id"))
private Folder audioMediaView;

@Column(name = "mediaView_audio_waveform")
private Boolean audioMediaViewWaveform = true;

/**
* Folder with media to use for the video preview.
Expand Down Expand Up @@ -553,6 +555,14 @@ public void setAudioMediaView(Folder audioMediaView) {
this.audioMediaView = audioMediaView;
}

public boolean isAudioMediaViewWaveform() {
return audioMediaViewWaveform;
}

public void setAudioMediaViewWaveform(boolean audioMediaViewWaveform) {
this.audioMediaViewWaveform = audioMediaViewWaveform;
}

/**
* Returns the folder to use for video preview.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--
-- (c) Kitodo. Key to digital objects e. V. <[email protected]>
--
-- This file is part of the Kitodo project.
--
-- It is licensed under GNU General Public License version 3 or later.
--
-- For the full copyright and license information, please read the
-- GPL3-License.txt file that was distributed with this source code.
--

--
-- Migration: Add column for state of audio waveform in media view to project table.
ALTER TABLE project ADD mediaView_audio_waveform TINYINT(1) NOT NULL DEFAULT 1
19 changes: 19 additions & 0 deletions Kitodo/src/main/java/org/kitodo/production/forms/ProjectForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,25 @@ public void setAudioMediaView(String audioMediaView) {
project.setAudioMediaView(getFolderMap().get(audioMediaView));
}

/**
* Returns the state of the audio media view waveform.
*
* @return True if enabled
*/
public boolean isAudioMediaViewWaveform() {
return project.isAudioMediaViewWaveform();
}

/**
* Sets the state of the audio media view waveform.
*
* @param audioMediaViewWaveform True if enabled
*
*/
public void setAudioMediaViewWaveform(boolean audioMediaViewWaveform) {
project.setAudioMediaViewWaveform(audioMediaViewWaveform);
}

/**
* Returns the folder to use for the video media view.
*
Expand Down
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ folderUse.audioPreview=Als Vorschau f\u00fcr Audios verwenden
folderUse.audioPreview.disabled=Vorschau f\u00fcr Audios deaktiviert
folderUse.audioMediaView=F\u00FCr die Medienansicht f\u00fcr Audios verwenden
folderUse.audioMediaView.disabled=Medienansicht f\u00fcr Audios deaktiviert
folderUse.audioMediaViewWaveform=Wellenform in der Medienansicht f\u00fcr Audios anzeigen
folderUse.generatorSource=Als Quelle zum Generieren von Inhalten verwenden
folderUse.generatorSource.disabled=Generieren von Inhalten deaktiviert
folderUse.mediaView=F\u00FCr die Medienansicht verwenden
Expand Down
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ folderUse.audioPreview=Use as preview for audios
folderUse.audioPreview.disabled=Preview for audios disabled
folderUse.audioMediaView=Use for the media view for audios
folderUse.audioMediaView.disabled=Media view for audios disabled
folderUse.audioMediaViewWaveform=Show waveform in media view for audios
folderUse.generatorSource=Use as source to generate contents
folderUse.generatorSource.disabled=Content generation disabled
folderUse.mediaView=Use for the media view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@
<p:ajax event="change" oncomplete="toggleSave()"/>
</p:selectOneMenu>

<p:outputLabel for="audioMediaViewWaveform" value="#{msgs['folderUse.audioMediaViewWaveform']}"
rendered="#{ProjectForm.hasAudioFolder()}" styleClass="la-folder-use" />
<p:selectBooleanCheckbox id="audioMediaViewWaveform" styleClass="switch input so-folder-use"
value="#{ProjectForm.audioMediaViewWaveform}" disabled="#{ProjectForm.locked}"
rendered="#{ProjectForm.hasAudioFolder()}">
</p:selectBooleanCheckbox>

<!-- folder for video preview -->
<p:outputLabel for="videoPreview" value="#{msgs['folderUse.videoPreview']}" styleClass="la-folder-use"
Expand Down

0 comments on commit 316a31e

Please sign in to comment.