aboutsummaryrefslogtreecommitdiff
path: root/packages/patches/add_mxt_file_extension_support-0.41.4.patch
blob: 17ae830e02bdec34b7febdf0c1ac0f127a70463b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Index: u_main.tk
===================================================================
--- u_main.tk	(revision 10595)
+++ u_main.tk	(working copy)
@@ -29,7 +29,8 @@
 	# set file types that open/save recognize
 	set filetypes {
 		{{Pd Files}         {.pd}  }
-		{{Max Text Files}   {.pat} }
+		{{Max Patch Files}  {.pat} }
+		{{Max Text Files}   {.mxt} }
 	}
 } elseif { $tcl_platform(os) == "Darwin" } {  
     set pd_nt 2
@@ -47,7 +48,8 @@
 	# set file types that open/save recognize
 	set filetypes {
 		{{Pd Files}               {.pd}  }
-		{{Max Text Files (.pat)}  {.pat} }
+		{{Max Patch Files (.pat)} {.pat} }
+		{{Max Text Files (.mxt)}  {.mxt} }
 	}
 } else { 
     set pd_nt 0
@@ -65,7 +67,8 @@
 	# set file types that open/save recognize
 	set filetypes {
 		{{pd files}         {.pd}  }
-		{{max text files}   {.pat} }
+		{{max patch files}  {.pat} }
+		{{max text files}   {.mxt} }
 	}
 }        
 
Index: m_binbuf.c
===================================================================
--- m_binbuf.c	(revision 10506)
+++ m_binbuf.c	(working copy)
@@ -870,7 +870,8 @@
     if (*dir)
         strcat(fbuf, dir), strcat(fbuf, "/");
     strcat(fbuf, filename);
-    if (!strcmp(filename + strlen(filename) - 4, ".pat"))
+    if (!strcmp(filename + strlen(filename) - 4, ".pat") ||
+        !strcmp(filename + strlen(filename) - 4, ".mxt"))
     {
         x = binbuf_convert(x, 0);
         deleteit = 1;
@@ -1348,7 +1349,8 @@
 void binbuf_evalfile(t_symbol *name, t_symbol *dir)
 {
     t_binbuf *b = binbuf_new();
-    int import = !strcmp(name->s_name + strlen(name->s_name) - 4, ".pat");
+    int import = !strcmp(name->s_name + strlen(name->s_name) - 4, ".pat") ||
+        !strcmp(name->s_name + strlen(name->s_name) - 4, ".mxt");
         /* set filename so that new canvases can pick them up */
     int dspstate = canvas_suspend_dsp();
     glob_setfilename(0, name, dir);
Index: g_readwrite.c
===================================================================
--- g_readwrite.c	(revision 10497)
+++ g_readwrite.c	(working copy)
@@ -728,7 +728,8 @@
     t_canvas *x2 = canvas_getrootfor(x);
     char *name = x2->gl_name->s_name;
     if (*name && strncmp(name, "Untitled", 8)
-            && (strlen(name) < 4 || strcmp(name + strlen(name)-4, ".pat")))
+            && (strlen(name) < 4 || strcmp(name + strlen(name)-4, ".pat")
+                || strcmp(name + strlen(name)-4, ".mxt")))
             canvas_savetofile(x2, x2->gl_name, canvas_getdir(x2));
     else canvas_menusaveas(x2);
 }
Index: u_main.tk
===================================================================
--- u_main.tk	(revision 10609)
+++ u_main.tk	(working copy)
@@ -521,7 +521,7 @@
     set directory [string range $filename 0 [expr [string last / $filename] - 1]]
     set pd_opendir $directory
     set basename [string range $filename [expr [string last / $filename] + 1] end]
-    if {[string last .pd $filename] >= 0} {
+    if {[regexp -nocase -- "\.(pd|pat|mxt)$" $filename]} {
         pd "pd open [pdtk_enquote $basename] [pdtk_enquote $directory] ;"
     }
 }