- Timestamp:
- 03/10/20 16:00:19 (4 years ago)
- Location:
- trunk/src/org
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apollo/widgets/SampledTrack.java
r1434 r1516 814 814 815 815 if (trackModel != null && trackModel.getFilepath() != null && 816 trackModel. equals(f.getPath())) {816 trackModel.getFilepath().equals(f.getPath())) { 817 817 818 818 // already have loaded … … 968 968 // If saving for the file time then get a filename 969 969 if (trackModel.getFilepath() == null) { 970 File audioResource = ResourceManager.getAudioResource(localFileName, DisplayController.getCurrentFrame()); 970 Frame parentFrame = this.getParentFrame(); 971 File audioResource = ResourceManager.getAudioUnusedFilename(localFileName, parentFrame); 971 972 trackModel.setFilepath(audioResource.getAbsolutePath()); 972 973 loadFilenameArgument = localFileName; // set to now local, next load will be local … … 1060 1061 //File oldLocalFile = new File(AudioPathManager.AUDIO_HOME_DIRECTORY + localFileName); 1061 1062 File oldLocalFile = ResourceManager.getAudioResource(localFileName, getParentFrame()); 1063 1064 if (oldLocalFile == null) { 1065 //It was never saved and therefore does not need to be deleted. 1066 return; 1067 } 1068 1062 1069 if (oldLocalFile.isFile() && oldLocalFile.exists()) { 1063 1070 try { -
trunk/src/org/expeditee/gui/management/ResourceManager.java
r1512 r1516 223 223 } 224 224 225 226 public static File getAudioUnusedFilename(String fileName, Frame parentFrame) { 227 List<String> directories = audio.getDirectories(parentFrame); 228 directories.add(FrameIO.PARENT_FOLDER); 229 for (String directory: directories) { 230 Path p = Paths.get(directory).resolve(fileName); 231 File file = p.toFile(); 232 if (!file.exists()) { 233 return file; 234 } 235 } 236 237 return null; 238 } 239 225 240 public static void invalidateAllResourceDirectories() { 226 241 commonInvalidated = true; … … 230 245 Frame currentFrame = DisplayController.getCurrentFrame(); 231 246 String framesetPath = currentFrame == null ? null : currentFrame.getFramesetPath(); 232 frames.refresh(framesetPath); 233 images.refresh(framesetPath); 234 audio.refresh(framesetPath); 247 refreshAll(framesetPath); 248 } 249 250 private static void refreshAll(String contextPath) { 251 frames.refresh(contextPath); 252 images.refresh(contextPath); 253 audio.refresh(contextPath); 235 254 } 236 255 … … 259 278 private List<String> getDirectories(String context) { 260 279 if (commonInvalidated) { 261 ResourceManager.refreshAll( );280 ResourceManager.refreshAll(context); 262 281 } else { 263 282 boolean requiresRefresh = context == null || contextFramesetPath == null || !contextFramesetPath.equals(context);
Note:
See TracChangeset
for help on using the changeset viewer.