ARLO Nester
Classes | Functions
workspace.tools.views.audio Namespace Reference

Classes

class  RenameMediaFileForm
 Form used by renameMediaFile. More...
 

Functions

def enableAllAudioFiles (request, projectId)
 Enable all audio files for a Project For all audio files in a Project, loop through and set them as 'active' Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific. More...
 
def disableAllAudioFiles (request, projectId)
 Disable all audio files for a Project For all audio files in a Project, loop through and set them as 'active' = false Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific. More...
 
def disableAudioFile (request, audioID, projectId)
 Disable an audio file from a project Set the audio file in a Project as 'active' = false Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific. More...
 
def enableAudioFile (request, audioID, projectId)
 Enable an audio file from a project Set the audio file in a Project as 'active' Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific. More...
 
def renameMediaFile (request, mediaID)
 Renames a mediaFile, either the alias and/or path name on disk. More...
 
def deleteAudioFile (audioID)
 Deletes wav file, jpgs, segments, features, MetaData, TagExamples, Tags. More...
 
def deleteAudio (request, audioID)
 Deletes MediaFile (by calling deleteAudioFile()) More...
 
def audioFiles (request)
 Display all media files owned by a user (/tools/audioFiles). More...
 
def getAudioInfo (request, tagID)
 mediaFiles = MediaFile.objects.filter(user=user).order_by('alias') mediaFiles = MediaFile.objects.filter(user=user).order_by('uploadDate').reverse() totalFiles = len(mediaFiles) mediaFiles = mediaFiles[0:userSettings.maxNumAudioFilesToList] More...
 
def deleteUserAudioFiles (request)
 Delete all Media Files for a user. More...
 
def importAudioFiles (request)
 Pass-through call to Java backend for mass import function. More...
 
def searchAudioFiles (request, projectId)
 Search through for AudioFiles alias and relativeFilePath. More...
 

Function Documentation

def workspace.tools.views.audio.audioFiles (   request)

Display all media files owned by a user (/tools/audioFiles).

Parameters
requestThe Django HTTP request object
Returns
Django HTTP response object
def workspace.tools.views.audio.deleteAudio (   request,
  audioID 
)

Deletes MediaFile (by calling deleteAudioFile())

Note
Only the MediaFile's owner can delete.
Parameters
audioIDThe ID of the media file to toggle
Returns
True on success, False otherwise
def workspace.tools.views.audio.deleteAudioFile (   audioID)

Deletes wav file, jpgs, segments, features, MetaData, TagExamples, Tags.

Note
Only the MediaFile's owner can delete.
Parameters
audioIDThe ID of the media file to delete
Returns
True on success, False otherwise
def workspace.tools.views.audio.deleteUserAudioFiles (   request)

Delete all Media Files for a user.

Parameters
requestThe Django HTTP request object
Returns
Django HTTP response object
def workspace.tools.views.audio.disableAllAudioFiles (   request,
  projectId 
)

Disable all audio files for a Project For all audio files in a Project, loop through and set them as 'active' = false Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific.

Parameters
requestThe Django HTTP request object
projectIdProject Id
Returns
Django HTTPResponse object
def workspace.tools.views.audio.disableAudioFile (   request,
  audioID,
  projectId 
)

Disable an audio file from a project Set the audio file in a Project as 'active' = false Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific.

Parameters
requestThe Django HTTP request object
audioIDThe ID of the media file to toggle
projectIdProject Id, only used for the response URL
Returns
Django HTTPResponse object
def workspace.tools.views.audio.enableAllAudioFiles (   request,
  projectId 
)

Enable all audio files for a Project For all audio files in a Project, loop through and set them as 'active' Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific.

Parameters
requestThe Django HTTP request object
projectIdProject Id
Returns
Django HTTPResponse object
def workspace.tools.views.audio.enableAudioFile (   request,
  audioID,
  projectId 
)

Enable an audio file from a project Set the audio file in a Project as 'active' Note: In future versions, we'll likely move the 'active' tag from tools_mediafile to something more project specific.

Parameters
requestThe Django HTTP request object
audioIDThe ID of the media file to toggle
projectIdProject Id, only used for the response URL
Returns
Django HTTPResponse object
def workspace.tools.views.audio.getAudioInfo (   request,
  tagID 
)

mediaFiles = MediaFile.objects.filter(user=user).order_by('alias') mediaFiles = MediaFile.objects.filter(user=user).order_by('uploadDate').reverse() totalFiles = len(mediaFiles) mediaFiles = mediaFiles[0:userSettings.maxNumAudioFilesToList]

MediaFileList = [] for mediaFile in mediaFiles: MediaFileList.append( ( mediaFile.id, 0, getMetaDataEntry(mediaFile, 'startTime'), mediaFile.alias, mediaFile.relativeFilePath, mediaFile.sensor, 0, getMetaDataEntry(mediaFile, 'durationInSeconds') )) Get AudioFile info associated with a Tag. Namely used by JavaScript to get the AudioFileId to to open the audio file of a tag.

Parameters
requestThe Django HTTP request
tagIDThe database Id of the Tag
Returns
JSON encoded dictionary; {'projectName', 'projectId', mediaFile 'alias', 'audioID' mediaFile Id}
def workspace.tools.views.audio.importAudioFiles (   request)

Pass-through call to Java backend for mass import function.

Note
This is currently a hidden function (i.e., you have to manually type and go to the URL)
Parameters
requestThe Django HTTP request object
Returns
Django HTTPResponse object (redirect to audioFiles())
def workspace.tools.views.audio.renameMediaFile (   request,
  mediaID 
)

Renames a mediaFile, either the alias and/or path name on disk.

Note
Expect a POST with a MediaFileRenameForm.
Only the MediaFile's owner can rename
Parameters
audioIDThe ID of the media file to rename
requestThe Django HTTP request
Returns
Django HTTPResponse Get the Form and data First try to rename path validate new path Update the Alias
def workspace.tools.views.audio.searchAudioFiles (   request,
  projectId 
)

Search through for AudioFiles alias and relativeFilePath.

Search through EITHER all files the user owns OR, if projectId is supplied, through all of the files in that project. If searchString is not supplied, return all files. Match against 'searchString' in the GET data.

Note
It is called AudioFiles, but now searches all media files
Parameters
requestThe Django HTTP request. Note that this expects a GET method with a 'searchString' variable.
projectIdThe database Id of a Project to search.
Returns
JSON encoded dictionary {totalFiles, filesReturned, filesDict}. filesDict is another dictionary {mediaID, alias, relativeFilePath, startTime, durationInSeconds, active, sensorName}