Skip to content

Commit

Permalink
bug fix panel
Browse files Browse the repository at this point in the history
when clicking on a word of transcription but the media has been moved from original spot on user computer so original file path does not match, but it is present in project panel. added support for this use case
  • Loading branch information
pietrop committed Aug 21, 2018
1 parent 857a2e8 commit 61b7fb5
Show file tree
Hide file tree
Showing 8 changed files with 4,002 additions and 11 deletions.
24 changes: 16 additions & 8 deletions adobe-panel-src/jsx/Premiere.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,18 @@ $._PPP = {
// no clip selected in project panel
else{
// see if file exists in project bin
// TODO:

// see if file exists on user's computer
var filePath = new File(options.filePath);
// TODO:
var arrayOfProjectItemsReferencingSomePath = app.project.rootItem.findItemsMatchingMediaPath( options.fileName, 1);
// if it finds the video element in project panel. loads it source panel.
if(arrayOfProjectItemsReferencingSomePath.length !== 0){
var clipInProjectPanel = arrayOfProjectItemsReferencingSomePath[0];
app.sourceMonitor.openFilePath(clipInProjectPanel.getMediaPath());
playTc(options.timecode);
return 'done';
}
else {
// see if file exists on user's computer
var filePath = new File(options.filePath);
if(filePath.exists){
// TODO: add project to adobe project
// var tmpFilesToImpot = [];
Expand All @@ -137,16 +145,16 @@ $._PPP = {

app.sourceMonitor.openFilePath(options.filePath);
playTc(options.timecode);
return 'done'
}
return 'done';
}
// if it is not present in either, returns error, file not found, add to project bin and try again.
else{
else {
// if autoEdit original file path does not exist anymore
// alert message, file not present, add file to premiere bin.
alert('file not present on computer, add and select file to premiere project panel and try again');
return 'file-not-found';
}

}
}

function playTc(timecode){
Expand Down
2 changes: 1 addition & 1 deletion lib/app/views/paperedit_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ exportEdlJSON: function(){
//'" + JSON.stringify({clips: this.model.get('events'), sequenceName: self.mode.get('title') })+"'
console.log('Paper-edit');
var tmpEdl = {edlJson: this.makeEDLJSON(false) };
// console.log(JSON.stringify( tmpEdl, null,2))
console.log(JSON.stringify( tmpEdl, null,2))
window.__adobe_cep__.evalScript("$._PPP.create_sequence_from_paper_edit('" + JSON.stringify(tmpEdl)+"')", function (response){
// done
})
Expand Down
2 changes: 1 addition & 1 deletion lib/app/views/transcription_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ module.exports = Backbone.View.extend({

console.log('Transcription');
// var tmpEdl = {edlJson: edlSq};
// console.log(JSON.stringify(tmpEdl, null,2));
console.log(JSON.stringify(tmpEdl, null,2));
window.__adobe_cep__.evalScript("$._PPP.create_sequence_from_paper_edit('" + JSON.stringify(tmpEdl)+"')", function (response){
// done
})
Expand Down
Loading

0 comments on commit 61b7fb5

Please sign in to comment.